From 25bdd38bb7fb6afa1eb32a9108ed37f13d6079b6 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 26 Jan 2021 21:42:03 -0800 Subject: Decode ICCID result --- src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/main/java/org') diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java index 755cfe33e..c5e8809e3 100644 --- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2020 Anton Tananaev (anton@traccar.org) + * Copyright 2012 - 2021 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -719,9 +719,13 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { int commandLength = buf.readUnsignedByte(); if (commandLength > 0) { - buf.readUnsignedByte(); // server flag (reserved) - position.set(Position.KEY_RESULT, - buf.readSlice(commandLength - 1).toString(StandardCharsets.US_ASCII)); + buf.readUnsignedInt(); // server flag (reserved) + String data = buf.readSlice(commandLength - 4).toString(StandardCharsets.US_ASCII); + if (data.startsWith("