aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Gt06ProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-11-23 09:44:37 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2017-11-23 09:44:37 +1300
commitb3e0f34d6dc7a996ffa70b02e480937268514b22 (patch)
tree2e931b1cad773aa6ece7d03eaf188db05be64991 /src/org/traccar/protocol/Gt06ProtocolDecoder.java
parent6c0fe165f72a998d447d0983c94e234681a6b680 (diff)
downloadtrackermap-server-b3e0f34d6dc7a996ffa70b02e480937268514b22.tar.gz
trackermap-server-b3e0f34d6dc7a996ffa70b02e480937268514b22.tar.bz2
trackermap-server-b3e0f34d6dc7a996ffa70b02e480937268514b22.zip
Support GK310 long cell format
Diffstat (limited to 'src/org/traccar/protocol/Gt06ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Gt06ProtocolDecoder.java6
1 files changed, 4 insertions, 2 deletions
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));