Ticket #45001

generate_packets.py: check for errors when sending all fields

Open Date: 2022-07-04 05:55 Last Update: 2022-07-06 04:01

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
1

Details

Part of #43927. Follow-up to #45000. Check return values of dio_put_*() for everything that is sent and move common parts out of Field.get_put_real() into Field.get_put() or (where applicable) Variant.get_send().

Ticket History (3/5 Histories)

2022-07-04 05:55 Updated by: alienvalkyrie
  • New Ticket "generate_packets.py: check for errors when all fields" created
2022-07-04 06:08 Updated by: alienvalkyrie
  • Summary Updated
2022-07-04 06:37 Updated by: alienvalkyrie
  • Resolution Update from None to Accepted
Comment

Note: This patch puts simplicity of the generation code over simplicity of the generated code, producing clunky-looking code for simple fields, like

  1. e = 0;
  2. e |= DIO_PUT(...);
  3. if (e) {
  4. log_packet_detailed("... field error detected");
  5. }
instead of the simpler
  1. if (DIO_PUT(...)) {
  2. log_packet_detailed("... field error detected");
  3. }
This will be a trend in further patches – the advantage being that the e |= DIO_PUT(...); line can be reused in other places (such as for array elements) in the future, and the surrounding code works equally well for less-simple fields (i.e. arrays).

2022-07-06 04:01 Updated by: alienvalkyrie
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed

Edit

Please login to add comment to this ticket » Login