diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-12-06 14:57:42 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-12-06 14:57:42 +1300 |
commit | e3f7a20c29a38dae64ffe0ab7724cc9df29a03f1 (patch) | |
tree | 5fb5651ac53ed39a94959e91598a40c7bb893ab0 | |
parent | 9ec8be4360ad3088af66d9fd432d9a85cd0ee074 (diff) | |
download | trackermap-server-e3f7a20c29a38dae64ffe0ab7724cc9df29a03f1.tar.gz trackermap-server-e3f7a20c29a38dae64ffe0ab7724cc9df29a03f1.tar.bz2 trackermap-server-e3f7a20c29a38dae64ffe0ab7724cc9df29a03f1.zip |
Support eelink messages without GPS
-rw-r--r-- | src/org/traccar/protocol/EelinkProtocolDecoder.java | 2 | ||||
-rw-r--r-- | test/org/traccar/protocol/EelinkProtocolDecoderTest.java | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/EelinkProtocolDecoder.java b/src/org/traccar/protocol/EelinkProtocolDecoder.java index 159a93d9b..98a9f7d6d 100644 --- a/src/org/traccar/protocol/EelinkProtocolDecoder.java +++ b/src/org/traccar/protocol/EelinkProtocolDecoder.java @@ -190,6 +190,8 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder { position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedShort())); position.setCourse(buf.readUnsignedShort()); position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); + } else { + getLastLocation(position, position.getDeviceTime()); } if (BitUtil.check(flags, 1)) { diff --git a/test/org/traccar/protocol/EelinkProtocolDecoderTest.java b/test/org/traccar/protocol/EelinkProtocolDecoderTest.java index ca70343bd..aaf58b438 100644 --- a/test/org/traccar/protocol/EelinkProtocolDecoderTest.java +++ b/test/org/traccar/protocol/EelinkProtocolDecoderTest.java @@ -55,7 +55,7 @@ public class EelinkProtocolDecoderTest extends ProtocolTest { verifyPosition(decoder, binary( "676702002509f65868507603a1e92e03cf90fe000000019f000117ee00111e0120631145003101510000")); - verifyPosition(decoder, binary( + verifyAttributes(decoder, binary( "676712001e0092579714d60201f90001785003a301cd1a006a118504f2000000000000")); verifyPosition(decoder, binary( |