diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2021-10-09 16:10:53 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2021-10-09 16:10:53 -0700 |
commit | 91e6409a0c012106cec454e5953fab2e4b558972 (patch) | |
tree | 4b19f0e0adf0abba087dd9ee2276112f6104064e | |
parent | cdb2d2aa151f900bf16af22538b6049daf7e494c (diff) | |
download | traccar-server-91e6409a0c012106cec454e5953fab2e4b558972.tar.gz traccar-server-91e6409a0c012106cec454e5953fab2e4b558972.tar.bz2 traccar-server-91e6409a0c012106cec454e5953fab2e4b558972.zip |
Handle no location
-rw-r--r-- | src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java | 4 | ||||
-rw-r--r-- | src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java index a9da34e6e..4c71d3724 100644 --- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -1253,6 +1253,10 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { } } + if (position.getFixTime() == null) { + getLastLocation(position, null); + } + sendResponse(channel, false, MSG_GPS_MODULAR, buf.readUnsignedShort(), null); return position; diff --git a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java index fd1eb3040..3caba32e6 100644 --- a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java @@ -17,6 +17,9 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest { verifyNull(decoder, binary( "78780D01086471700328358100093F040D0A")); + verifyNotNull(decoder, binary( + "797900377000000001020035000103002c0004616219d00043000b013601048153931500001a0001000808652820400643521000000101004e46760d0a")); + verifyNull(decoder, binary( "7878171915061810051a01f90101700d08c8f50c0000065494ae0d0a")); |