aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java2
-rw-r--r--src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
index 859d850d1..c0e9541a4 100644
--- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -887,7 +887,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
} else if (subType == 0x0a) {
buf.skipBytes(8); // imei
buf.skipBytes(8); // imsi
- position.set(Position.KEY_ICCID, ByteBufUtil.hexDump(buf.readSlice(8)));
+ position.set(Position.KEY_ICCID, ByteBufUtil.hexDump(buf.readSlice(10)).replaceAll("f", ""));
return position;
} else if (subType == 0x0d) {
if (buf.getByte(buf.readerIndex()) != '!') {
diff --git a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
index 3e022765e..46d6a6dab 100644
--- a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
@@ -17,6 +17,10 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest {
verifyNull(decoder, binary(
"78780D01086471700328358100093F040D0A"));
+ verifyAttribute(decoder, binary(
+ "79790020940a035985708236675805200502187214018966051912408052452f000355560d0a"),
+ Position.KEY_ICCID, "8966051912408052452");
+
verifyPosition(decoder, binary(
"7878252612030C063816C3026C10540C38C9700144030901CC002866000EEE0C06040302000DA2DB0D0A"));