aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorwkhaksar <31837615+wkhaksar@users.noreply.github.com>2022-06-29 09:02:15 +0200
committerGitHub <noreply@github.com>2022-06-29 09:02:15 +0200
commit7899f1ffbb0e00243d2b4cf72ffe9bc59bb920bc (patch)
treef2930199aa71a82f51d3e9babaa6f49d448e8152 /src/main/java
parent9345f8e086105ba30e9e9cf87b3fc5b0740d68e8 (diff)
downloadtrackermap-server-7899f1ffbb0e00243d2b4cf72ffe9bc59bb920bc.tar.gz
trackermap-server-7899f1ffbb0e00243d2b4cf72ffe9bc59bb920bc.tar.bz2
trackermap-server-7899f1ffbb0e00243d2b4cf72ffe9bc59bb920bc.zip
time advance moved to inner block
added a check for 0 mac address on wifi networks.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/traccar/protocol/WatchProtocolDecoder.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java b/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java
index 35fdc3ca5..a71c5606d 100644
--- a/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java
@@ -142,8 +142,8 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder {
Network network = new Network();
int cellCount = Integer.parseInt(values[index++]);
- index += 1; // timing advance
if (cellCount > 0) {
+ index += 1; // timing advance
int mcc = !values[index].isEmpty() ? Integer.parseInt(values[index++]) : 0;
int mnc = !values[index].isEmpty() ? Integer.parseInt(values[index++]) : 0;
@@ -164,8 +164,11 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder {
for (int i = 0; i < wifiCount; i++) {
index += 1; // wifi name
- network.addWifiAccessPoint(WifiAccessPoint.from(
- values[index++], Integer.parseInt(values[index++])));
+ String macAddress = values[index++];
+ String rssi = values[index++];
+ if (!macAddress.isEmpty() && !macAddress.equals("0") && !rssi.isEmpty()) {
+ network.addWifiAccessPoint(WifiAccessPoint.from(macAddress, Integer.parseInt(rssi)));
+ }
}
}