From ab4f951c53e4e6ee15637d78943d538d0c68be51 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 2 Apr 2019 21:39:42 -0700 Subject: Support Ruptela driver id --- src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java b/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java index b043b6201..a9ab5f5fe 100644 --- a/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java @@ -194,6 +194,14 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder { decodeParameter(position, id, buf, 8); } + Long driverIdPart1 = (Long) position.getAttributes().remove(Position.PREFIX_IO + 126); + Long driverIdPart2 = (Long) position.getAttributes().remove(Position.PREFIX_IO + 127); + if (driverIdPart1 != null && driverIdPart2 != null) { + ByteBuf driverId = Unpooled.copyLong(driverIdPart1, driverIdPart2); + position.set(Position.KEY_DRIVER_UNIQUE_ID, driverId.toString(StandardCharsets.US_ASCII)); + driverId.release(); + } + positions.add(position); } -- cgit v1.2.3