WPIRoboticsEngineering / RBE1001Lib

A library to support introduction to robotics engineering.
MIT License
4 stars 4 forks source link

Bulk label update packet (0x1d) restructure (proposal) #44

Open mworzala opened 4 years ago

mworzala commented 4 years ago

There is an established "String" type used in other packets (4 bytes to represent the length, and then the variable number of characters afterwards) such as Console Data (0x11) and New Value Index (0x1F).

As it stands, bulk value update contains a list of "elements" each specifying the offset and length of their associated string in a single long concatenated string data segment at the end of the packet.

It seems like it would be more consistent to use the common format inside this list of indices. And it would make the packet smaller! Something like the following:

Packet ID Field Name Field Type Notes
0x1d Number of labels (n) Unsigned Int
Once for each n Index Unsigned Int The label index to update.
String Length Unsigned Int
String Data Bytes Of length "String Length"

Note: This would make it so that each list element is not a set length, but I don't see any major problems with this.