openlcb / OpenLCB_Java

A git-managed copy of the SVN-based Java prototype implementation of OpenLCB. This implementation operates inside JMRI.
6 stars 9 forks source link

SNIP message response can fall out of spec #211

Closed rm5248 closed 4 months ago

rm5248 commented 1 year ago

When querying JMRI for Simple Node Information, the following messages will come back:

[[19a086e5] 1A 5D 04 4A 4D 52 49 00]  S: SNIP Reply 1st frame
[[19a086e5] 3A 5D 50 61 6E 65 6C 50]  S: SNIP Reply middle frame
[[19a086e5] 3A 5D 72 6F 00 50 72 6F]  S: SNIP Reply middle frame
[[19a086e5] 3A 5D 66 69 6C 65 20 4D]  S: SNIP Reply middle frame
[[19a086e5] 3A 5D 79 20 4A 4D 52 49]  S: SNIP Reply middle frame
[[19a086e5] 3A 5D 20 52 61 69 6C 72]  S: SNIP Reply middle frame
[[19a086e5] 3A 5D 6F 61 64 00 35 2E]  S: SNIP Reply middle frame
[[19a086e5] 3A 5D 32 2B 52 37 36 30]  S: SNIP Reply middle frame
[[19a086e5] 3A 5D 62 39 38 35 33 37]  S: SNIP Reply middle frame
[[19a086e5] 2A 5D 66 00 02 00 00   ]  S: 02.01.12.FE.56.8C - 04.00.32.40.50.01 Simple Node Ident Info with content '4,JMRI,PanelPro,Profile My JMRI Railroad,5.2+R760b98537f,2,,,'

The data is as follows:

04 - Version
4A 4D 52 49 00 - Manufacturer(JMRI, 4 chars)
50 61 6E 65 6C 50 72 6F 00 - Model(PanelPro, 8 chars)
50 72 6F 66 69 6C 65 20 4D 79 20 4A 4D 52 49 20 52 61 69 6C 72 6F 61 64 00  - Node hardware version(Profile My JMRI Railroad, 24 chars)
35 2E 32 2B 52 37 36 30 62 39 38 35 33 37 66 00 - Node software version(5.2+R760b98537f, 15 chars)
02 - Version
00 - node name(0 chars)
00 - node description(0 chars)

With the above message, the node hardware version field is too large by 4 chars. The spec says for the node hardware version:

A null-terminated string for node hardware version of no more than 21 bytes including terminating null.

bobjacobsen commented 1 year ago

Fix is in JMRI/JMRI#11898

dpharris commented 4 months ago

Resolved with updates.