aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-10-05 08:52:25 -0700
committerAnton Tananaev <anton@traccar.org>2022-10-05 08:52:25 -0700
commitbb78e15201e88fba4c71bb08d98d0f0bc5acecbf (patch)
tree13f4827b99b67ded2ea5f7c7cdb4d9f1a2a69c1d /src/main/java
parent2e0cdf2cec9be08392be2ae8826e14bc757db186 (diff)
downloadtrackermap-server-bb78e15201e88fba4c71bb08d98d0f0bc5acecbf.tar.gz
trackermap-server-bb78e15201e88fba4c71bb08d98d0f0bc5acecbf.tar.bz2
trackermap-server-bb78e15201e88fba4c71bb08d98d0f0bc5acecbf.zip
Decode RFTRACK WiFi info
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/traccar/protocol/RfTrackProtocolDecoder.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/RfTrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/RfTrackProtocolDecoder.java
index be9b23e37..28a3ac29c 100644
--- a/src/main/java/org/traccar/protocol/RfTrackProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/RfTrackProtocolDecoder.java
@@ -26,6 +26,7 @@ import org.traccar.model.CellTower;
import org.traccar.model.Command;
import org.traccar.model.Network;
import org.traccar.model.Position;
+import org.traccar.model.WifiAccessPoint;
import org.traccar.session.DeviceSession;
import javax.json.Json;
@@ -126,6 +127,14 @@ public class RfTrackProtocolDecoder extends BaseHttpProtocolDecoder {
case "cob":
position.set("pressureChanges", value);
break;
+ case "wifi":
+ JsonArray wifiInfo = Json.createReader(new StringReader(value)).readArray();
+ for (int i = 0; i < wifiInfo.size(); i++) {
+ JsonObject wifi = wifiInfo.getJsonObject(i);
+ network.addWifiAccessPoint(WifiAccessPoint.from(
+ wifi.getString("m").replace('-', ':'), wifi.getInt("l")));
+ }
+ break;
case "u_ids":
position.set("unpairedIds", value);
break;