aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-01-24 23:20:13 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2019-01-24 23:20:13 -0800
commit5080f966f6221c774604b02f9d40fc48c90e71ca (patch)
tree508bfdcf58897f676f67b33a2d4c2f24acdc24aa
parent08c744db5dd60956827c6002841c30067ae55744 (diff)
downloadtraccar-server-5080f966f6221c774604b02f9d40fc48c90e71ca.tar.gz
traccar-server-5080f966f6221c774604b02f9d40fc48c90e71ca.tar.bz2
traccar-server-5080f966f6221c774604b02f9d40fc48c90e71ca.zip
Handle no fuel timestamp
-rw-r--r--src/org/traccar/protocol/Gt06ProtocolDecoder.java4
-rw-r--r--test/org/traccar/protocol/Gt06ProtocolDecoderTest.java3
2 files changed, 6 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
index 7c7c485a8..6388455b5 100644
--- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -766,7 +766,9 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
position.set("iccid", ByteBufUtil.hexDump(buf.readSlice(8)));
return position;
} else if (subType == 0x0d) {
- buf.skipBytes(6);
+ if (buf.getByte(buf.readerIndex()) != '!') {
+ buf.skipBytes(6);
+ }
return decodeFuelData(position, buf.toString(
buf.readerIndex(), buf.readableBytes() - 4 - 2, StandardCharsets.US_ASCII));
}
diff --git a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java
index 6cc2d3f86..570cd7506 100644
--- a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java
@@ -178,6 +178,9 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest {
verifyAttributes(decoder, binary(
"7979003F940D110315102A202141494F494C2C30322C3030382E3239302C3032392E3630302C3531394A2C303430302C3030382E3433302C302C30302C4142001678EA0D0A"));
+ verifyAttributes(decoder, binary(
+ "79790039940d2141494f494c2c30322c3030322e3732302c3032392e3530302c3532344a2c303130302c3030332e3430302c302c30302c393309ad72000d0a"));
+
verifyNull(decoder, binary(
"79790005840016BB1A0D0A"));