From c089e9161835be70f1ef3f30c170b82ce8eafa80 Mon Sep 17 00:00:00 2001 From: Orlando Zelada Date: Thu, 19 Dec 2024 09:41:49 -0300 Subject: [PATCH 1/2] Update utils.js add raw and direction to decodeRecordData40 method in utils --- utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils.js b/utils.js index 97ce15b..9d2be28 100644 --- a/utils.js +++ b/utils.js @@ -145,6 +145,8 @@ module.exports.decodeUserData72 = (userData)=>{ module.exports.decodeRecordData40 = (recordData)=>{ const record = { + raw: recordData, + direction: recordData.readUIntLE(26, 1), userSn: recordData.readUIntLE(0, 2), deviceUserId: recordData .slice(2, 2+9) @@ -233,4 +235,4 @@ module.exports.checkNotEventTCP = (data)=> { module.exports.checkNotEventUDP = (data)=>{ const commandId = this.decodeUDPHeader(data.subarray(0,8)).commandId return commandId === COMMANDS.CMD_REG_EVENT -} \ No newline at end of file +} From 3a886556f003930cad5f321cc5d75e0a711f7b69 Mon Sep 17 00:00:00 2001 From: Orlando Zelada Date: Thu, 19 Dec 2024 09:44:22 -0300 Subject: [PATCH 2/2] Update utils.js --- utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.js b/utils.js index 9d2be28..5a3a132 100644 --- a/utils.js +++ b/utils.js @@ -145,7 +145,7 @@ module.exports.decodeUserData72 = (userData)=>{ module.exports.decodeRecordData40 = (recordData)=>{ const record = { - raw: recordData, + raw: recordData, direction: recordData.readUIntLE(26, 1), userSn: recordData.readUIntLE(0, 2), deviceUserId: recordData