diff options
author | Anton Tananaev <anton@traccar.org> | 2023-03-23 09:51:52 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-03-23 09:51:52 -0700 |
commit | b083371beb7b5d32b8ce91da60e10dd3cf8b4c6b (patch) | |
tree | bf26785ac426c2493913b92b39d8d110f90a4807 | |
parent | 7c2f9e56ba5f699d22ec2939408357b5a220bacc (diff) | |
download | trackermap-server-b083371beb7b5d32b8ce91da60e10dd3cf8b4c6b.tar.gz trackermap-server-b083371beb7b5d32b8ce91da60e10dd3cf8b4c6b.tar.bz2 trackermap-server-b083371beb7b5d32b8ce91da60e10dd3cf8b4c6b.zip |
Decode alarm code and input
-rw-r--r-- | src/main/java/org/traccar/protocol/T800xProtocolDecoder.java | 2 | ||||
-rw-r--r-- | src/test/java/org/traccar/protocol/T800xProtocolDecoderTest.java | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/T800xProtocolDecoder.java b/src/main/java/org/traccar/protocol/T800xProtocolDecoder.java index 758716d23..4ddea730c 100644 --- a/src/main/java/org/traccar/protocol/T800xProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/T800xProtocolDecoder.java @@ -400,6 +400,7 @@ public class T800xProtocolDecoder extends BaseProtocolDecoder { int alarm = buf.readUnsignedByte(); position.set(Position.KEY_ALARM, header != 0x2727 ? decodeAlarm1(alarm) : decodeAlarm2(alarm)); + position.set("alarmCode", alarm); if (header != 0x2727) { @@ -470,6 +471,7 @@ public class T800xProtocolDecoder extends BaseProtocolDecoder { int inputStatus = buf.readUnsignedShort(); position.set(Position.KEY_IGNITION, BitUtil.check(inputStatus, 2)); position.set(Position.KEY_RSSI, BitUtil.between(inputStatus, 4, 11)); + position.set(Position.KEY_INPUT, inputStatus); buf.readUnsignedShort(); // ignition on upload interval buf.readUnsignedInt(); // ignition off upload interval diff --git a/src/test/java/org/traccar/protocol/T800xProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/T800xProtocolDecoderTest.java index 246687149..3f62a834c 100644 --- a/src/test/java/org/traccar/protocol/T800xProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/T800xProtocolDecoderTest.java @@ -12,6 +12,9 @@ public class T800xProtocolDecoderTest extends ProtocolTest { var decoder = inject(new T800xProtocolDecoder(null)); verifyAttributes(decoder, binary( + "272704004901380864112055585747c612230321220006000036435fc8acc2ee600f420000000000000000909019003900001356a18000012c0000a8c00000001e20d4800000c00000")); + + verifyAttributes(decoder, binary( "2525110055000208677300508924902206262035310c540045004c00430045004c0004454447450847534d20313930300f323134303734323036373835323839143839333430373131373930303936383037363846")); verifyAttributes(decoder, binary( |