message parse fail
nivthetool opened this issue · comments
Hi, and 10x for sharing your parser
my alarm system sends the following message that fails in parsing
9F0D001A"SIA-DCS"0001L[#9999|NBA2]
here is the exact log lines
[2019-02-11T15:34:33.599] [DEBUG] sia - received from ::1:53662 following data: {"type":"Buffer","data":[10,57,70,48,68,48,48,49,65,34,83,73,65,45,68,67,83,34,48,48,48,49,76,91,35,57,57,57,57,124,78,66,65,50,93,13,0]}
console.js:7
[2019-02-11T15:34:33.600] [INFO] sia - received from ::1:53662 following message: 9F0D001A"SIA-DCS"0001L[#9999|NBA2]
any idea?
real thanks in advance.
digging more...
my sia.str is
"SIA-DCS"0001L[#9999|NBA2]
code fail at
regex = /\"(.+)\"(\d{4})(R(.{1,6})){0,1}(L(.{1,6}))\#([\w\d]+)\[(.+)/gm;
m = regex.exec(sia.str);
i get m equals null
hope it helps you
TIA
Hi, I will take a look. Which alarm system you are using?
Okay, the account prefix and account number is missing. It would be interesting which system you are using. Is it possible to add in the alarm system for sia messages an account number / Prefix?
The missing fields are marked with bold letters.
"SIA-DCS"0001L0#9999[#9999|NBA2]
Take a look here:
http://s545463982.onlinehome.us/DC09Gen/
https://www.yumpu.com/en/document/read/47594214/dc-09-preparing-for-ansi-public-review-security-industry-
fixed the error in Version 1.0.1. Unfortunately the alarm systems send the CRC in two different ways:
- 0xABCD (like Lupusec alarm system)
- ABCD (like your systems does)
the version 1.0.1 can handle both version.
Please test the version and give me a feedback.