aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-09-07 11:43:25 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-09-07 11:43:54 -0700
commit7a4f5abd6c0ce56032f8e095e94ff4acf170aef6 (patch)
tree8dcda52ce13d5bd96f693287fd49c15958a0fa1d /src
parent6202fdd44ece635f2b97386d1db82e0572e838c0 (diff)
downloadtrackermap-server-7a4f5abd6c0ce56032f8e095e94ff4acf170aef6.tar.gz
trackermap-server-7a4f5abd6c0ce56032f8e095e94ff4acf170aef6.tar.bz2
trackermap-server-7a4f5abd6c0ce56032f8e095e94ff4acf170aef6.zip
Support extended heartbeat
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/EelinkProtocolDecoder.java3
-rw-r--r--src/test/java/org/traccar/protocol/EelinkProtocolDecoderTest.java4
2 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/EelinkProtocolDecoder.java b/src/main/java/org/traccar/protocol/EelinkProtocolDecoder.java
index a6fd94b83..41d76f37f 100644
--- a/src/main/java/org/traccar/protocol/EelinkProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/EelinkProtocolDecoder.java
@@ -412,7 +412,8 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder {
return decodeNew(deviceSession, buf, type, index);
- } else if (type == MSG_HEARTBEAT && buf.readableBytes() >= 2) {
+ } else if (type == MSG_HEARTBEAT && buf.readableBytes() >= 2
+ || type == MSG_OBD && buf.readableBytes() == 4) {
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
diff --git a/src/test/java/org/traccar/protocol/EelinkProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/EelinkProtocolDecoderTest.java
index e3cff9525..e24da3173 100644
--- a/src/test/java/org/traccar/protocol/EelinkProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/EelinkProtocolDecoderTest.java
@@ -14,6 +14,10 @@ public class EelinkProtocolDecoderTest extends ProtocolTest {
verifyNull(decoder, binary(
"454C0027E753035254407167747167670100180002035254407167747100200205020500010432000086BD"));
+ verifyAttribute(decoder, binary(
+ "6767070006000e0077035d"),
+ Position.KEY_IGNITION, true);
+
verifyAttributes(decoder, binary(
"676707006502df5c89fde800bc3fa8030302005555045b555555057a5555550b225555550c105c55550d115555550e7e5555550f4555555510017b5555112b5555551f01ed5555208005b0012100005555407ad000004237f5555589000000498a0000aef78b00000000"));