aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-06-15 06:53:13 -0700
committerAnton Tananaev <anton@traccar.org>2024-06-15 06:53:13 -0700
commitbc65eb120807b7c899d3fd95fbb6684934bfa3ef (patch)
treeb48cbd60b050423ef70edbee835eef5cc7194ede /src/main/java
parent0c6880698769d87a866ebbb60c84dbe13ee42ce7 (diff)
downloadtrackermap-server-bc65eb120807b7c899d3fd95fbb6684934bfa3ef.tar.gz
trackermap-server-bc65eb120807b7c899d3fd95fbb6684934bfa3ef.tar.bz2
trackermap-server-bc65eb120807b7c899d3fd95fbb6684934bfa3ef.zip
Support GT06 RFID card
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
index a1a9c3773..0c23f42d3 100644
--- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -65,6 +65,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
public static final int MSG_STRING = 0x15;
public static final int MSG_GPS_LBS_STATUS_1 = 0x16;
public static final int MSG_WIFI = 0x17;
+ public static final int MSG_GPS_LBS_RFID = 0x17;
public static final int MSG_GPS_LBS_STATUS_2 = 0x26;
public static final int MSG_GPS_LBS_STATUS_3 = 0x27;
public static final int MSG_LBS_MULTIPLE_1 = 0x28;
@@ -125,6 +126,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
JC400,
SL4X,
SEEWORLD,
+ RFID,
}
private Variant variant;
@@ -175,6 +177,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
case MSG_GPS_PHONE:
case MSG_GPS_LBS_EXTEND:
case MSG_GPS_LBS_7:
+ case MSG_GPS_LBS_RFID:
case MSG_FENCE_SINGLE:
case MSG_FENCE_MULTI:
return true;
@@ -197,6 +200,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
case MSG_GPS_LBS_STATUS_3:
case MSG_GPS_LBS_STATUS_4:
case MSG_GPS_LBS_7:
+ case MSG_GPS_LBS_RFID:
case MSG_FENCE_SINGLE:
case MSG_FENCE_MULTI:
case MSG_LBS_ALARM:
@@ -602,7 +606,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
return null;
- } else if (type == MSG_WIFI || type == MSG_WIFI_2 || type == MSG_WIFI_4) {
+ } else if ((type == MSG_WIFI && variant != Variant.RFID) || type == MSG_WIFI_2 || type == MSG_WIFI_4) {
ByteBuf time = buf.readSlice(6);
DateBuilder dateBuilder = new DateBuilder()
@@ -945,6 +949,11 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
}
}
+ if (type == MSG_GPS_LBS_RFID) {
+ buf.readUnsignedByte(); // validity
+ position.set(Position.KEY_DRIVER_UNIQUE_ID, ByteBufUtil.hexDump(buf.readSlice(8)));
+ }
+
if (buf.readableBytes() == 3 + 6 || buf.readableBytes() == 3 + 4 + 6) {
position.set(Position.KEY_IGNITION, buf.readUnsignedByte() > 0);
buf.readUnsignedByte(); // upload mode
@@ -1492,6 +1501,8 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
variant = Variant.SEEWORLD;
} else if (header == 0x7878 && type == MSG_GPS_LBS_STATUS_1 && length == 0x26) {
variant = Variant.SEEWORLD;
+ } else if (header == 0x7878 && type == MSG_GPS_LBS_RFID && length == 0x28) {
+ variant = Variant.RFID;
} else {
variant = Variant.STANDARD;
}