diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2021-05-20 21:33:26 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2021-05-20 21:33:26 -0700 |
commit | f697d6fad3648a8da2ad3bca9ff14263859a8e71 (patch) | |
tree | 58dfc743942dc66372efcc454c5c1717e33cc113 | |
parent | 4e624c4a3446cff59d3247565d4455f531636389 (diff) | |
download | trackermap-server-f697d6fad3648a8da2ad3bca9ff14263859a8e71.tar.gz trackermap-server-f697d6fad3648a8da2ad3bca9ff14263859a8e71.tar.bz2 trackermap-server-f697d6fad3648a8da2ad3bca9ff14263859a8e71.zip |
Add Teltonika panic support
-rw-r--r-- | src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java | 5 | ||||
-rw-r--r-- | src/test/java/org/traccar/protocol/TeltonikaProtocolDecoderTest.java | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java index 74b4be8d5..6ba183f9b 100644 --- a/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java @@ -312,6 +312,11 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder { break; } break; + case 389: + if (BitUtil.between(readValue(buf, length, false), 4, 8) == 1) { + position.set(Position.KEY_ALARM, Position.ALARM_SOS); + } + break; default: position.set(Position.PREFIX_IO + id, readValue(buf, length, false)); break; diff --git a/src/test/java/org/traccar/protocol/TeltonikaProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/TeltonikaProtocolDecoderTest.java index 5577a08ac..082d410c2 100644 --- a/src/test/java/org/traccar/protocol/TeltonikaProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/TeltonikaProtocolDecoderTest.java @@ -15,6 +15,9 @@ public class TeltonikaProtocolDecoderTest extends ProtocolTest { "000F313233343536373839303132333435")); verifyPositions(decoder, binary( + "00000000000000b98e0200000179555c7bf8010b3a1cfbebc142b00000000000000000ec000f000900f00000150000c80000450200710100740001070100fa0000ec01000500b500000018000000430d560044000000190000000100f1000000000000000000000179555c83c8010b3a1cfbebc142b0000000000000000185000f000900f00000150000c80000450200710100740001070100fa00018511000500b500000018000000430d560044000000190000000100f100000000000000000200003251")); + + verifyPositions(decoder, binary( "00000000000000a38e0100000178b11c9e1000040bbbc91f03190c002100e113001300000010000600ef0100f00100150300c800004501001e070005004237e00018000a00ce166200430f970024059f000300f10000665900c70000001e00100000a1b500000002010000115756315a5a5a32455a38363031353338380119002950303239392c50303637352c50303637342c50303637322c50303637312c50303437312c50324241430100001ad8")); verifyPositions(decoder, binary( |