Looking at the OPTOMUX PROTOCOL GUIDE, I need some info on the various field widths in the ASCII command examples.
I am seeing a variation in the length of positions, modifier, and info fields. Now for positions, it seems that the length could be determined by the number of digits required for the upper most set bit. The modifier and info field lengths when present seem to be command dependent.
Page 83 shows the message >11Z66L015842cr. Positions get 2 digits and info gets 2 digits per value.
Page 99 shows the message >FFJ000A4003Bcr. Positions gets 4 digits even though top 3 are 0, and info gets 3 digits due to I guess the 12 bit analog nature.
Page 101 shows the message >D0S0224FFF0C01F0ABcr. Positions gets 4 digits and 3 analog values get 3 digits each again I assume due to 12 bit nature.
As a verification, I want to create the exact messages in my code shown in the examples without wasting effort on things in the examples that are not a requirement, ie: I don’t really want to keep a positions field width spec by command if it is unnecessary.
So for the positions field, the number of hex digits seems to vary among example messages. Am I free to shorten the field to drop upper zeros? That is how do I know to do 66 instead of 0066 or 066, or A instead of 000A, 00A, or 0A? I am attempting to use the example messages to verify my packet output including checksum, but it is a concern if some messages expect positions to be four digits, and some to drop upper zeros.
The same is true about the data or modifier fields. It seems like analog output commands may want 3 digits for parsing, but other commands may want 2 digits, or even 1 digit.