diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-09-15 13:49:57 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-09-15 13:49:57 +1200 |
commit | dc3559a9cc49206e87f26349b8f8a41398f299b5 (patch) | |
tree | db065051c3899127d2e41aa1456f0e0f8d52ac41 | |
parent | 1d884d5660b827964e10d4dc95d95ee6838e0aca (diff) | |
download | trackermap-server-dc3559a9cc49206e87f26349b8f8a41398f299b5.tar.gz trackermap-server-dc3559a9cc49206e87f26349b8f8a41398f299b5.tar.bz2 trackermap-server-dc3559a9cc49206e87f26349b8f8a41398f299b5.zip |
Decode alternative GT06 info message
-rw-r--r-- | src/org/traccar/protocol/Gt06ProtocolDecoder.java | 11 | ||||
-rw-r--r-- | test/org/traccar/protocol/Gt06ProtocolDecoderTest.java | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java index e3be8d5ab..9570eac96 100644 --- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -516,6 +516,17 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { return decodeWifi(buf, deviceSession); + } else if (type == MSG_INFO) { + + Position position = new Position(getProtocolName()); + position.setDeviceId(deviceSession.getDeviceId()); + + getLastLocation(position, null); + + position.set(Position.KEY_POWER, buf.readShort() * 0.01); + + return position; + } else { return decodeBasicOther(channel, buf, deviceSession, type, dataLength); diff --git a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java index 8c884f366..bb7e2bdba 100644 --- a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java @@ -16,6 +16,9 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest { verifyNull(decoder, binary( "78780D01086471700328358100093F040D0A")); + verifyAttributes(decoder, binary( + "7878079404eb001c705d0d0a")); + verifyNotNull(decoder, binary( "78781219028f0a29e10036f12003040102000875dc0d0a")); |