david284 / ModuleDescriptor

VLCB/CBUS Module descriptor format & examples
0 stars 2 forks source link

Vallues for Index High and Low appear swapped #20

Open RichardCrawshaw opened 4 months ago

RichardCrawshaw commented 4 months ago

All ten instances of nodeVariableIndexHigh and nodeVariableIndexLow appear to be swapped.

From CANCMD-A50A-4d

      "nodeVariableIndexHigh": 11,
      "nodeVariableIndexLow": 12

I would expect the low value to be 11 and the high value to be 12. The instances in the Text Fixture files exhibit the same issue, just with values 3 & 4.

david284 commented 4 months ago

It all depends on the 'byte order' of the two variables it's trying to process If the byte order is 'high byte' as NV11 and 'low byte' as NV12 then this is correct as shown - I believe this is Big endian, and is the way most two bytes values are represented in the CBUS protocol (e.g. node numbers)

RichardCrawshaw commented 4 months ago

Ah, that makes sense. I had been expecting that IndexHigh was the higher numbered NV and indexLow was the lower numbered NV. Perhaps a documentation update to clarify that point.