diff options
author | Matjaž Črnko <m.crnko@txt.si> | 2023-06-12 23:22:21 +0200 |
---|---|---|
committer | Matjaž Črnko <m.crnko@txt.si> | 2023-06-12 23:22:21 +0200 |
commit | 3ac7982d48bd7b3ed207a1461bc90a1cb7a888c4 (patch) | |
tree | 5f05dd0ee74c7062d6de3948b2758529a75cf1e0 /src/main/java | |
parent | 532c414196d94661e31c48332ff4f598c27ebbcf (diff) | |
download | trackermap-server-3ac7982d48bd7b3ed207a1461bc90a1cb7a888c4.tar.gz trackermap-server-3ac7982d48bd7b3ed207a1461bc90a1cb7a888c4.tar.bz2 trackermap-server-3ac7982d48bd7b3ed207a1461bc90a1cb7a888c4.zip |
Ruptela - decode TCO Driver ID and BLE Beacon ID
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java b/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java index 737d30f10..8a9bf21a4 100644 --- a/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java @@ -285,6 +285,22 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder { driverId.release(); } + Long tcoDriverIdPart1 = (Long) position.getAttributes().remove(Position.PREFIX_IO + 155); + Long tcoDriverIdPart2 = (Long) position.getAttributes().remove(Position.PREFIX_IO + 156); + if (tcoDriverIdPart1 != null && tcoDriverIdPart2 != null) { + ByteBuf driverId = Unpooled.copyLong(tcoDriverIdPart1, tcoDriverIdPart2); + position.set(Position.KEY_DRIVER_UNIQUE_ID, driverId.toString(StandardCharsets.US_ASCII)); + driverId.release(); + } + + Long bleBeaconIdPart1 = (Long) position.getAttributes().remove(Position.PREFIX_IO + 760); + Long bleBeaconIdPart2 = (Long) position.getAttributes().remove(Position.PREFIX_IO + 761); + if (bleBeaconIdPart1 != null && bleBeaconIdPart2 != null) { + ByteBuf bleBeaconId = Unpooled.copyLong(bleBeaconIdPart1, bleBeaconIdPart2); + position.set("bleBeaconId", bleBeaconId.toString(StandardCharsets.US_ASCII)); + bleBeaconId.release(); + } + positions.add(position); } |