From edae1e1ba8e3cd1f2aebf9e40abda33ced75ce7c Mon Sep 17 00:00:00 2001 From: Scott Bender Date: Tue, 18 Jun 2024 10:47:17 -0400 Subject: [PATCH] fix: support alternate date format in actisense formatted messages (#273) --- lib/stringMsg.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/stringMsg.js b/lib/stringMsg.js index 80a5a5c..3d19727 100644 --- a/lib/stringMsg.js +++ b/lib/stringMsg.js @@ -45,7 +45,8 @@ function toPaddedHexString(num, len) { } // 2016-02-28T19:57:02.364Z,2,127250,7,255,8,ff,10,3b,ff,7f,ce,f5,fc -exports.isActisense = input => input.charAt(10) === 'T' && input.charAt(23) === 'Z' +exports.isActisense = input => (input.charAt(10) === 'T' && input.charAt(23) === 'Z') || (input.charAt(10) === '-' && input.charAt(23) === ',') + exports.parseActisense = (input) => { const [ timestamp, prio, pgn, src, dst, len, ...data ] = input.split(',') return buildMsg(