-
Notifications
You must be signed in to change notification settings - Fork 39
Description
Open Protocol spec defines rev 6 with these new fields:
sequenceNumberSupportlinkingHandlingSupportstationIDstationNameclientID
Missing Keys / Fields
The parser is missing the last three keys:
node-open-protocol/src/mid/0002.js
Line 72 in f514d00
processKey(msg, buffer, "linkingHandlingSupport", 13, 2, position, cb) && node-open-protocol/test/0002.spec.js
Lines 191 to 205 in f514d00
payload: { cellID: 1, channelID: 1, controllerName: "Teste Airbag", supplierCode: "ABC", openProtocolVersion: "AAAAAAAAAAAAAAAAAAA", controllerSoftwareVersion: "BBBBBBBBBBBBBBBBBBB", toolSoftwareVersion: "CCCCCCCCCCCCCCCCCCC", rbuType: "AS254DFCVFDCVGTREDFGHJKL", controllerSerialNumber: "123987ASD6", systemType: 3, systemSubtype: 2, sequenceNumberSupport: 0, linkingHandlingSupport: 1 }
Interestingly, the serializer has all the keys:
node-open-protocol/src/mid/0002.js
Lines 191 to 200 in f514d00
serializerField(msg, buf, "clientID", "number", 1, position, cb) && serializerKey(msg, buf, 16, 2, position, cb) && serializerField(msg, buf, "stationName", "string", 25, position, cb) && serializerKey(msg, buf, 15, 2, position, cb) && serializerField(msg, buf, "stationID", "string", 10, position, cb) && serializerKey(msg, buf, 14, 2, position, cb) && serializerField(msg, buf, "linkingHandlingSupport", "number", 1, position, cb) && serializerKey(msg, buf, 13, 2, position, cb) && serializerField(msg, buf, "sequenceNumberSupport", "number", 1, position, cb) && serializerKey(msg, buf, 12, 2, position, cb); node-open-protocol/test/0002.spec.js
Lines 378 to 395 in f514d00
payload: { cellID: 1, channelID: 1, controllerName: "Teste Airbag", supplierCode: "ABC", openProtocolVersion: "AAAAAAAAAAAAAAAAAAA", controllerSoftwareVersion: "BBBBBBBBBBBBBBBBBBB", toolSoftwareVersion: "CCCCCCCCCCCCCCCCCCC", rbuType: "AS254DFCVFDCVGTREDFGHJKL", controllerSerialNumber: "123987ASD6", systemType: 3, systemSubtype: 2, sequenceNumberSupport: 0, linkingHandlingSupport: 1, stationID: "AESDR56RDT", stationName: "QASWWEDXCVFR562 DERF34EDF", clientID: 9 }
I would expect the parser and serializer to behave as inverses to each other.
Wrong type for stationID
Additionally, the type for stationID is also wrong. The official protocol says it's supposed to be a number, but node-open-protocol tries to interpret it as a string!