From e7c04ee2af5b2bdabc58647c11ec059281dccae0 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 21 Jan 2016 12:52:52 +1300 Subject: Fix alarm and status decoding (fix #1675) --- src/org/traccar/protocol/EelinkProtocolDecoder.java | 2 +- test/org/traccar/protocol/EelinkProtocolDecoderTest.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/org/traccar/protocol/EelinkProtocolDecoder.java b/src/org/traccar/protocol/EelinkProtocolDecoder.java index f81e22bee..2aa18c20c 100644 --- a/src/org/traccar/protocol/EelinkProtocolDecoder.java +++ b/src/org/traccar/protocol/EelinkProtocolDecoder.java @@ -89,7 +89,7 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder { position.set(Event.KEY_MCC, buf.readUnsignedShort()); position.set(Event.KEY_MNC, buf.readUnsignedShort()); position.set(Event.KEY_LAC, buf.readUnsignedShort()); - position.set(Event.KEY_CID, buf.readUnsignedShort()); + position.set(Event.KEY_CID, buf.readUnsignedMedium()); position.setValid((buf.readUnsignedByte() & 0x01) != 0); diff --git a/test/org/traccar/protocol/EelinkProtocolDecoderTest.java b/test/org/traccar/protocol/EelinkProtocolDecoderTest.java index a8fac5dbc..d7a6c5e86 100644 --- a/test/org/traccar/protocol/EelinkProtocolDecoderTest.java +++ b/test/org/traccar/protocol/EelinkProtocolDecoderTest.java @@ -13,6 +13,9 @@ public class EelinkProtocolDecoderTest extends ProtocolTest { verifyNothing(decoder, binary( "676701000c002603541880486128290120")); + verifyPosition(decoder, binary( + "676704001c01a4569ff2dd0517a0f7020b0d9a06011000d8001e005b0004450183")); + verifyPosition(decoder, binary( "676705002200ba569fc3520517a0d8020b0f740f007100d8001e005b0004460101569fd162001f")); -- cgit v1.2.3