diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/traccar/protocol/RfTrackProtocolDecoder.java | 9 |
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; |