diff options
author | David Bergh <berghdavid@hotmail.com> | 2023-09-11 09:20:38 +0200 |
---|---|---|
committer | David Bergh <berghdavid@hotmail.com> | 2023-09-11 09:20:38 +0200 |
commit | 33f0df11d027a48be2c3c1030198855311e13d00 (patch) | |
tree | 620a315c6090f796bee9022303c1e46f556d8d0a /src/main/java | |
parent | bb46ff66b74731dd7c7b2359017b0cd8c137824c (diff) | |
download | trackermap-server-33f0df11d027a48be2c3c1030198855311e13d00.tar.gz trackermap-server-33f0df11d027a48be2c3c1030198855311e13d00.tar.bz2 trackermap-server-33f0df11d027a48be2c3c1030198855311e13d00.zip |
Reformat MAC + inline
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java index 3ee9d9732..0b17b3ee7 100644 --- a/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java @@ -550,7 +550,7 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { case 0x23: case 0x24: case 0x25: - String wifiMAC = ByteBufUtil.hexDump(buf.readSlice(6)); + String wifiMAC = ByteBufUtil.hexDump(buf.readSlice(6)).replaceAll("(..)", "$1:"); int wifiRSSI = buf.readShortLE(); network.addWifiAccessPoint(WifiAccessPoint.from(wifiMAC, wifiRSSI)); break; @@ -559,13 +559,8 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { case 0x10: case 0x12: case 0x13: - int stationMCC = buf.readUnsignedShortLE(); - int stationMNC = buf.readUnsignedShortLE(); - int stationLAC = buf.readUnsignedShortLE(); - long stationID = buf.readUnsignedIntLE(); - int stationRX_LEVEL = buf.readShortLE(); - network.addCellTower(CellTower.from(stationMCC, stationMNC, stationLAC, stationID, - stationRX_LEVEL)); + network.addCellTower(CellTower.from(buf.readUnsignedShortLE(), buf.readUnsignedShortLE(), + buf.readUnsignedShortLE(), buf.readUnsignedIntLE(), buf.readShortLE())); break; case 0x2A: case 0x2B: @@ -582,8 +577,7 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { position.set("networkVersion", buf.readUnsignedByte()); position.set("networkType", buf.readUnsignedByte()); int networkDescLen = buf.readUnsignedByte(); - String networkDesc = buf.readSlice(networkDescLen).toString(StandardCharsets.US_ASCII); - network.setRadioType(networkDesc); + network.setRadioType(buf.readSlice(networkDescLen).toString(StandardCharsets.US_ASCII)); break; case 0xFE31: buf.readUnsignedByte(); // alarm protocol |