diff --git a/src/mid/0002.js b/src/mid/0002.js index 1a99554..473f83f 100644 --- a/src/mid/0002.js +++ b/src/mid/0002.js @@ -71,6 +71,12 @@ function parser(msg, opts, cb) { processParser(msg, buffer, "sequenceNumberSupport", "number", 1, position, cb) && processKey(msg, buffer, "linkingHandlingSupport", 13, 2, position, cb) && processParser(msg, buffer, "linkingHandlingSupport", "number", 1, position, cb) && + processKey(msg, buffer, "stationID", 14, 2, position, cb) && + processParser(msg, buffer, "stationID", "number", 10, position, cb) && + processKey(msg, buffer, "stationName", 15, 2, position, cb) && + processParser(msg, buffer, "stationName", "string", 25, position, cb) && + processKey(msg, buffer, "clientID", 16, 2, position, cb) && + processParser(msg, buffer, "clientID", "number", 1, position, cb) && cb(null, msg); break; @@ -192,7 +198,7 @@ function serializer(msg, opts, 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) && + serializerField(msg, buf, "stationID", "number", 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) && diff --git a/test/0002.spec.js b/test/0002.spec.js index b1fcf76..3087170 100644 --- a/test/0002.spec.js +++ b/test/0002.spec.js @@ -176,7 +176,7 @@ describe("MID 0002", () => { let msg = { mid: 2, revision: 6, - payload: Buffer.from("010001020103Teste Airbag 04ABC05AAAAAAAAAAAAAAAAAAA06BBBBBBBBBBBBBBBBBBB07CCCCCCCCCCCCCCCCCCC08AS254DFCVFDCVGTREDFGHJKL09123987ASD61000311002120131") + payload: Buffer.from("010001020103Teste Airbag 04ABC05AAAAAAAAAAAAAAAAAAA06BBBBBBBBBBBBBBBBBBB07CCCCCCCCCCCCCCCCCCC08AS254DFCVFDCVGTREDFGHJKL09123987ASD6100031100212013114429496729515QASWWEDXCVFR562 DERF34EDF169") }; MID.parser(msg, {}, (err, data) => { @@ -201,7 +201,10 @@ describe("MID 0002", () => { systemType: 3, systemSubtype: 2, sequenceNumberSupport: 0, - linkingHandlingSupport: 1 + linkingHandlingSupport: 1, + stationID: 4294967295, + stationName: "QASWWEDXCVFR562 DERF34EDF", + clientID: 9, } }); @@ -389,7 +392,7 @@ describe("MID 0002", () => { systemSubtype: 2, sequenceNumberSupport: 0, linkingHandlingSupport: 1, - stationID: "AESDR56RDT", + stationID: 4294967295, stationName: "QASWWEDXCVFR562 DERF34EDF", clientID: 9 } @@ -404,7 +407,7 @@ describe("MID 0002", () => { expect(data).to.be.deep.equal({ mid: 2, revision: 6, - payload: Buffer.from("010001020103Teste Airbag 04ABC05AAAAAAAAAAAAAAAAAAA06BBBBBBBBBBBBBBBBBBB07CCCCCCCCCCCCCCCCCCC08AS254DFCVFDCVGTREDFGHJKL09123987ASD6100031100212013114AESDR56RDT15QASWWEDXCVFR562 DERF34EDF169") + payload: Buffer.from("010001020103Teste Airbag 04ABC05AAAAAAAAAAAAAAAAAAA06BBBBBBBBBBBBBBBBBBB07CCCCCCCCCCCCCCCCCCC08AS254DFCVFDCVGTREDFGHJKL09123987ASD6100031100212013114429496729515QASWWEDXCVFR562 DERF34EDF169") }); done(); diff --git a/test/sessionControlClient.spec.js b/test/sessionControlClient.spec.js index 1eb3ee1..e7bf14e 100644 --- a/test/sessionControlClient.spec.js +++ b/test/sessionControlClient.spec.js @@ -831,7 +831,7 @@ describe("Session Control Client", () => { switch (step) { case 0: - stream.push(Buffer.from("01790002006 0000010000020003PA160LDA2 04ACT052.2 0610.15.6 07 08Silver (Ag) 09D240003 1000111001121130\u0000")); + stream.push(Buffer.from("02210002006 0000010000020003PA160LDA2 04ACT052.2 0610.15.6 07 08Silver (Ag) 09D240003 100011100112113014429496729515QASWWEDXCVFR562 DERF34EDF169\u0000")); step += 1; break;