aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/B2316ProtocolDecoder.java3
-rw-r--r--src/test/java/org/traccar/ProtocolTest.java2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/B2316ProtocolDecoder.java b/src/main/java/org/traccar/protocol/B2316ProtocolDecoder.java
index a45c315b3..635806b2d 100644
--- a/src/main/java/org/traccar/protocol/B2316ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/B2316ProtocolDecoder.java
@@ -116,8 +116,9 @@ public class B2316ProtocolDecoder extends BaseProtocolDecoder {
String[] points = item.getString("wi").split(";");
for (String point : points) {
String[] values = point.split(",");
+ String mac = values[0].replaceAll("(..)", "$1:");
network.addWifiAccessPoint(WifiAccessPoint.from(
- values[0].replaceAll("(..)", "$1:"), Integer.parseInt(values[1])));
+ mac.substring(0, mac.length() - 1), Integer.parseInt(values[1])));
}
}
diff --git a/src/test/java/org/traccar/ProtocolTest.java b/src/test/java/org/traccar/ProtocolTest.java
index 3e27bbe28..5e37f44b9 100644
--- a/src/test/java/org/traccar/ProtocolTest.java
+++ b/src/test/java/org/traccar/ProtocolTest.java
@@ -323,7 +323,7 @@ public class ProtocolTest extends BaseTest {
if (position.getNetwork().getWifiAccessPoints() != null) {
for (WifiAccessPoint wifiAccessPoint : position.getNetwork().getWifiAccessPoints()) {
- assertTrue("validation failed for mac address with zero value", !wifiAccessPoint.getMacAddress().equals("0"));
+ assertTrue(wifiAccessPoint.getMacAddress().matches("((\\p{XDigit}{2}):){5}(\\p{XDigit}{2})"));
}
}
}