aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-12-14 07:23:08 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2017-12-14 07:23:08 +1300
commit0c8bf8867456c55231f2aabf36970504d4e8cab7 (patch)
tree23a0813b8e3f8a7eb19357cef18c3be77eeef0d8
parent44ecf67fef0cce59430e6216fcd2dfa4d5c2bcbd (diff)
downloadtrackermap-server-0c8bf8867456c55231f2aabf36970504d4e8cab7.tar.gz
trackermap-server-0c8bf8867456c55231f2aabf36970504d4e8cab7.tar.bz2
trackermap-server-0c8bf8867456c55231f2aabf36970504d4e8cab7.zip
Implement GK310 geofence support
-rw-r--r--src/org/traccar/protocol/Gt06ProtocolDecoder.java4
-rw-r--r--test/org/traccar/protocol/Gt06ProtocolDecoderTest.java4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
index 2c1468250..0fdd5ba10 100644
--- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -630,6 +630,10 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedShort();
}
+ if (type == MSG_GPS_LBS_STATUS_3) {
+ position.set(Position.KEY_GEOFENCE, buf.readUnsignedByte());
+ }
+
sendResponse(channel, false, type, null);
return position;
diff --git a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java
index 7f191d664..50fdd6cba 100644
--- a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java
@@ -19,8 +19,8 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest {
verifyAttributes(decoder, binary(
"78780B23C00122040001000818720D0A"));
- /*verifyNotNull(decoder, binary(
- "78782727110c070f1a338000000000000000000004002d81360104cb8a00bef30004030c02ff0004f4d20d0a"));*/
+ verifyNotNull(decoder, binary(
+ "78782727110c0b0e170f850450059107f461ae001c7e0a81360104cb8a00bef32806030c02ff000316b10d0a"));
verifyNotNull(decoder, binary(
"78782322110c070f1b0270000000000000000000040081360104cb8a00bef3000000000523030d0a"));