diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-07-02 00:56:11 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-07-02 00:56:11 -0700 |
commit | 3ceee5bc5d3d5c94045e1f2ff14e0cd801bfa5d4 (patch) | |
tree | 8648e2ca9ee736374684f1c825027cf6160d41eb | |
parent | b2a95573bd75e8fac4f44c7bfebf353df89976f3 (diff) | |
download | traccar-server-3ceee5bc5d3d5c94045e1f2ff14e0cd801bfa5d4.tar.gz traccar-server-3ceee5bc5d3d5c94045e1f2ff14e0cd801bfa5d4.tar.bz2 traccar-server-3ceee5bc5d3d5c94045e1f2ff14e0cd801bfa5d4.zip |
Decode Aplicom event data
-rw-r--r-- | src/org/traccar/protocol/AplicomProtocolDecoder.java | 12 | ||||
-rw-r--r-- | test/org/traccar/protocol/AplicomProtocolDecoderTest.java | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/AplicomProtocolDecoder.java b/src/org/traccar/protocol/AplicomProtocolDecoder.java index 54b15700a..14ab83788 100644 --- a/src/org/traccar/protocol/AplicomProtocolDecoder.java +++ b/src/org/traccar/protocol/AplicomProtocolDecoder.java @@ -102,6 +102,18 @@ public class AplicomProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedInt(); buf.readUnsignedByte(); break; + case 119: + StringBuilder sb = new StringBuilder(); + while (buf.isReadable()) { + char c = (char) buf.readByte(); + if (c >= 0x20) { + sb.append(c); + } else { + break; + } + } + position.set("eventData", sb.toString()); + break; case 121: case 142: buf.readLong(); diff --git a/test/org/traccar/protocol/AplicomProtocolDecoderTest.java b/test/org/traccar/protocol/AplicomProtocolDecoderTest.java index 862cff055..c92844e9a 100644 --- a/test/org/traccar/protocol/AplicomProtocolDecoderTest.java +++ b/test/org/traccar/protocol/AplicomProtocolDecoderTest.java @@ -11,6 +11,9 @@ public class AplicomProtocolDecoderTest extends ProtocolTest { AplicomProtocolDecoder decoder = new AplicomProtocolDecoder(new AplicomProtocol());
verifyAttributes(decoder, binary(
+ "44c30144f667ca8e6b002d00305f7700d45b307a9a5b307a97031f840a00c6f05b0600000083000000263433233031303138373433303746230d0a"));
+
+ verifyAttributes(decoder, binary(
"44c30144f667c4316500e903ffdfbc00f059aebeb659aebeb302e3f5860065fe32120000ae0000000e47000000000000000000000000000127cd0000014c00000000000000ff010a002900000000000000014542016d0001010090070e140144f667c4316559ae620402e3f7f300660714c0010d15ff0f3332373937313100000000000000000000002a01010737341d331fffcf0103020b8601060c0001a5860001a58600000000010b1001ca01ca7d007d007c7cffffffffffff010a240000ffff0000000100010001ffff0000ffffffffffffffffffffffffffff00000002ffff010c06fec6febffeec"));
verifyAttributes(decoder, binary(
|