aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-03-06 13:53:03 -0800
committerAnton Tananaev <anton@traccar.org>2022-03-06 13:53:03 -0800
commit09ee3fb9ac865d88f1966cd67fcba67d3c69e390 (patch)
treed8b03242bcbf12d56697c857cf8befc2e2a9e8ba /src/main/java/org/traccar/protocol
parent4d0c564b3e8a82de392ad9672c87586d9d24f73c (diff)
downloadtrackermap-server-09ee3fb9ac865d88f1966cd67fcba67d3c69e390.tar.gz
trackermap-server-09ee3fb9ac865d88f1966cd67fcba67d3c69e390.tar.bz2
trackermap-server-09ee3fb9ac865d88f1966cd67fcba67d3c69e390.zip
Support Wanway S20 format
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r--src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
index ec09f371b..4d3448e84 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 - 2021 Anton Tananaev (anton@traccar.org)
+Supp * Copyright 2012 - 2022 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.
@@ -712,11 +712,17 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
getLastLocation(position, dateBuilder.getDate());
+ boolean hasCellCount = type == MSG_LBS_MULTIPLE_3 && dataLength == 44;
+
+ if (hasCellCount) {
+ buf.readUnsignedByte(); // ta
+ }
+
int mcc = buf.readUnsignedShort();
int mnc = BitUtil.check(mcc, 15) ? buf.readUnsignedShort() : buf.readUnsignedByte();
Network network = new Network();
- int cellCount = type == MSG_WIFI_5 ? 6 : 7;
+ int cellCount = hasCellCount ? buf.readUnsignedByte() : type == MSG_WIFI_5 ? 6 : 7;
for (int i = 0; i < cellCount; i++) {
int lac = longFormat ? buf.readInt() : buf.readUnsignedShort();
int cid = longFormat ? (int) buf.readLong() : buf.readUnsignedMedium();
@@ -726,7 +732,9 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
}
}
- buf.readUnsignedByte(); // time leads
+ if (!hasCellCount) {
+ buf.readUnsignedByte(); // ta
+ }
if (type != MSG_LBS_MULTIPLE_1 && type != MSG_LBS_MULTIPLE_2 && type != MSG_LBS_MULTIPLE_3
&& type != MSG_LBS_2) {