aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-10-27 23:25:29 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-10-27 23:25:29 -0700
commitb90829bf06ff2f150a9818224a10b825906cd686 (patch)
treef9b741816434580d5a3fa9429c673853eba68b61 /src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java
parent3593d6075cbc40460e91cfccb4f2fb7c9913e315 (diff)
downloadtrackermap-server-b90829bf06ff2f150a9818224a10b825906cd686.tar.gz
trackermap-server-b90829bf06ff2f150a9818224a10b825906cd686.tar.bz2
trackermap-server-b90829bf06ff2f150a9818224a10b825906cd686.zip
Decode magnetic card
Diffstat (limited to 'src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java
index 70972f847..4a23d57d0 100644
--- a/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java
@@ -206,7 +206,12 @@ public class FifotrackProtocolDecoder extends BaseProtocolDecoder {
}
if (parser.hasNext()) {
- position.set(Position.KEY_DRIVER_UNIQUE_ID, String.valueOf(parser.nextHexInt()));
+ String rfid = parser.next();
+ if (rfid.matches("\\p{XDigit}+")) {
+ position.set(Position.KEY_DRIVER_UNIQUE_ID, String.valueOf(Integer.parseInt(rfid, 16)));
+ } else {
+ position.set("driverLicense", rfid);
+ }
}
if (parser.hasNext()) {