Skip to content

Commit

Permalink
fix: support alternate date format in actisense formatted messages (#273
Browse files Browse the repository at this point in the history
)
  • Loading branch information
sbender9 authored Jun 18, 2024
1 parent 6bc159b commit edae1e1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/stringMsg.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit edae1e1

Please sign in to comment.