From a3a086cfda4219815cba4ea6ca2cb44028c1e091 Mon Sep 17 00:00:00 2001 From: Matjaž Črnko Date: Tue, 13 Jun 2023 13:37:24 +0200 Subject: Ruptela - tested bleBeaconID decoding --- src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/main/java/org') diff --git a/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java b/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java index 8a9bf21a4..2680e56b2 100644 --- a/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java @@ -293,12 +293,10 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder { 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(); + Long bleBeaconIdP1 = (Long) position.getAttributes().remove(Position.PREFIX_IO + 760); + Long bleBeaconIdP2 = (Long) position.getAttributes().remove(Position.PREFIX_IO + 761); + if (bleBeaconIdP1 != null && bleBeaconIdP2 != null) { + position.set("bleBeaconId", Long.toHexString(bleBeaconIdP1) + Long.toHexString(bleBeaconIdP2)); } positions.add(position); -- cgit v1.2.3