From b3e0f34d6dc7a996ffa70b02e480937268514b22 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 23 Nov 2017 09:44:37 +1300 Subject: Support GK310 long cell format --- src/org/traccar/protocol/Gt06ProtocolDecoder.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/org') diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java index 7703650a4..2018fb6a6 100644 --- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -528,6 +528,8 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { if (type == MSG_LBS_MULTIPLE || type == MSG_LBS_EXTEND || type == MSG_LBS_WIFI || type == MSG_LBS_2 || type == MSG_WIFI_3) { + boolean longFormat = type == MSG_LBS_2 || type == MSG_WIFI_3; + DateBuilder dateBuilder = new DateBuilder(timeZone) .setDate(buf.readUnsignedByte(), buf.readUnsignedByte(), buf.readUnsignedByte()) .setTime(buf.readUnsignedByte(), buf.readUnsignedByte(), buf.readUnsignedByte()); @@ -538,8 +540,8 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { int mnc = buf.readUnsignedByte(); Network network = new Network(); for (int i = 0; i < 7; i++) { - int lac = buf.readUnsignedShort(); - int cid = buf.readUnsignedMedium(); + int lac = longFormat ? buf.readInt() : buf.readUnsignedShort(); + int cid = longFormat ? (int) buf.readLong() : buf.readUnsignedMedium(); int rssi = -buf.readUnsignedByte(); if (lac > 0) { network.addCellTower(CellTower.from(mcc, mnc, lac, cid, rssi)); -- cgit v1.2.3