diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-12-15 05:20:03 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-12-15 05:20:03 +1300 |
commit | c60b59121e7afc32198beaed3b69cdd04a882219 (patch) | |
tree | 189282a57174c3211f2ec3b522fba16bea9c4fa1 | |
parent | c2e96b39909581e949279464c7a94aeecbcf4e21 (diff) | |
download | trackermap-server-c60b59121e7afc32198beaed3b69cdd04a882219.tar.gz trackermap-server-c60b59121e7afc32198beaed3b69cdd04a882219.tar.bz2 trackermap-server-c60b59121e7afc32198beaed3b69cdd04a882219.zip |
Add support for multi-fence type
-rw-r--r-- | src/org/traccar/protocol/Gt06ProtocolDecoder.java | 4 | ||||
-rw-r--r-- | test/org/traccar/protocol/Gt06ProtocolDecoderTest.java | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java index adce11eab..37f64ee02 100644 --- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -118,6 +118,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { case MSG_GPS_LBS_EXTEND: case MSG_GPS_2: case MSG_FENCE_SINGLE: + case MSG_FENCE_MULTI: return true; default: return false; @@ -135,6 +136,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { case MSG_GPS_LBS_STATUS_3: case MSG_GPS_2: case MSG_FENCE_SINGLE: + case MSG_FENCE_MULTI: case MSG_LBS_ALARM: case MSG_LBS_ADDRESS: return true; @@ -630,7 +632,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedShort(); } - if (type == MSG_GPS_LBS_STATUS_3) { + if (type == MSG_GPS_LBS_STATUS_3 || type == MSG_FENCE_MULTI) { position.set(Position.KEY_GEOFENCE, buf.readUnsignedByte()); } diff --git a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java index 5404f4e55..13bc6e38d 100644 --- a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java @@ -19,7 +19,7 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest { verifyAttributes(decoder, binary( "78780B23C00122040001000818720D0A")); - verifyNull(decoder, binary( + verifyNotNull(decoder, binary( "78782EA4110C0C02281BF6026C18720C38D22800149C1181CC00010000260E000000000615F8012C05041102FF001058FD0D0A")); verifyNotNull(decoder, binary( |