From dd848b71892c7f5f2554cf793dc123f8f456ddb5 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 18 Aug 2019 11:51:03 -0700 Subject: Implement RFID support --- src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/main') diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java index ee28a5062..eeb0ae9f2 100644 --- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -86,6 +86,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { public static final int MSG_COMMAND_2 = 0x82; public static final int MSG_TIME_REQUEST = 0x8A; public static final int MSG_INFO = 0x94; + public static final int MSG_RFID = 0x9B; public static final int MSG_STRING_INFO = 0x21; public static final int MSG_GPS_2 = 0xA0; public static final int MSG_LBS_2 = 0xA1; @@ -942,6 +943,18 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { return position; + } else if (type == MSG_RFID) { + + getLastLocation(position, null); + + buf.readUnsignedByte(); // external device type code + buf.readUnsignedByte(); // card type + position.set( + Position.KEY_DRIVER_UNIQUE_ID, + buf.readCharSequence(buf.readableBytes() - 9, StandardCharsets.US_ASCII).toString()); + + return position; + } else { return decodeExtendedOther(channel, buf, deviceSession, type); -- cgit v1.2.3