aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-03-23 10:24:47 -0700
committerAnton Tananaev <anton@traccar.org>2022-03-23 10:24:47 -0700
commit2c5d65c30159b620eebce8dd7b8a768c06271031 (patch)
tree82bee0575b9723c0a7a4d2139e4f56f50c980d94 /src/main/java/org/traccar/protocol
parentf5033ee29a955796fb4c911f83e3d8253c98e62e (diff)
downloadtrackermap-server-2c5d65c30159b620eebce8dd7b8a768c06271031.tar.gz
trackermap-server-2c5d65c30159b620eebce8dd7b8a768c06271031.tar.bz2
trackermap-server-2c5d65c30159b620eebce8dd7b8a768c06271031.zip
Fix TK915-4GSA decoding
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r--src/main/java/org/traccar/protocol/WatchProtocolDecoder.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java b/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java
index cf58b0fed..4ab7875b7 100644
--- a/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java
@@ -149,9 +149,14 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder {
int mnc = !values[index].isEmpty() ? Integer.parseInt(values[index++]) : 0;
for (int i = 0; i < cellCount; i++) {
- network.addCellTower(CellTower.from(mcc, mnc,
- Integer.parseInt(values[index++]), Integer.parseInt(values[index++]),
- Integer.parseInt(values[index++])));
+ int lac = Integer.parseInt(values[index++]);
+ int cid = Integer.parseInt(values[index++]);
+ String rssi = values[index++];
+ if (!rssi.isEmpty()) {
+ network.addCellTower(CellTower.from(mcc, mnc, lac, cid, Integer.parseInt(rssi)));
+ } else {
+ network.addCellTower(CellTower.from(mcc, mnc, lac, cid));
+ }
}
if (index < values.length && !values[index].isEmpty()) {