diff options
-rw-r--r-- | src/org/traccar/protocol/CalAmpProtocolDecoder.java | 2 | ||||
-rw-r--r-- | test/org/traccar/protocol/CalAmpProtocolDecoderTest.java | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/CalAmpProtocolDecoder.java b/src/org/traccar/protocol/CalAmpProtocolDecoder.java index 47d7bf483..2a4af2f03 100644 --- a/src/org/traccar/protocol/CalAmpProtocolDecoder.java +++ b/src/org/traccar/protocol/CalAmpProtocolDecoder.java @@ -121,7 +121,7 @@ public class CalAmpProtocolDecoder extends BaseProtocolDecoder { int accCount = BitUtil.to(buf.readUnsignedByte(), 6); if (type != MSG_MINI_EVENT_REPORT) { - buf.readUnsignedByte(); // reserved + position.set("append", buf.readUnsignedByte()); } if (accType == 1) { diff --git a/test/org/traccar/protocol/CalAmpProtocolDecoderTest.java b/test/org/traccar/protocol/CalAmpProtocolDecoderTest.java index 9ed4c4a43..8d7d5f9fe 100644 --- a/test/org/traccar/protocol/CalAmpProtocolDecoderTest.java +++ b/test/org/traccar/protocol/CalAmpProtocolDecoderTest.java @@ -11,6 +11,12 @@ public class CalAmpProtocolDecoderTest extends ProtocolTest { CalAmpProtocolDecoder decoder = new CalAmpProtocolDecoder(new CalAmpProtocol()); verifyPosition(decoder, binary( + "8305133303910501010102004557E5AB2457E3B3E01FD828DBFE9E3465000028C90000004201310704001EFFA12F0B22081BCA05000000000000000F87000E8E2F00EA029E0000082D")); + + verifyPosition(decoder, binary( + "8305313301481601010102045557ea2eba57ea2eba1ebf06db005f2e5e0000220c00000000000006200000ff8f000a00000bca06000000000000000f1b000f35ef00ea02900000087000000060")); + + verifyPosition(decoder, binary( "8305454205067001010102008157a9bddc57a96aaa17cdb98fccc1a457000056ac00000000000007250000ff8f000e00082711570000000000ffff101b00003148000010680000000000000000000000050000000000000000000005b0000000000000289600000000000000000000069b00000000000008e400000000000000000000000000000003000000010000070f")); verifyPosition(decoder, binary( |