aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-06-19 17:44:37 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-06-19 17:44:37 -0700
commit29c560027dc3ecdf59d13cd11a6423047d9ed95a (patch)
tree88ef309b93e4ddbb9de8d0a06cafb273e2016742 /src/main/java/org
parent0497f1da3dd4f7a2bc94cd9418ea6fe896615f97 (diff)
downloadtraccar-server-29c560027dc3ecdf59d13cd11a6423047d9ed95a.tar.gz
traccar-server-29c560027dc3ecdf59d13cd11a6423047d9ed95a.tar.bz2
traccar-server-29c560027dc3ecdf59d13cd11a6423047d9ed95a.zip
Fix driver id decoding
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java
index 2e728a918..cc4eaa790 100644
--- a/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java
@@ -69,7 +69,7 @@ public class FifotrackProtocolDecoder extends BaseProtocolDecoder {
.number("(x+),") // cid
.number("([x|]+)") // adc
.expression(",([^,]+)") // rfid
- .expression(",([^*]+)").optional(2) // sensors
+ .expression(",([^*]*)").optional(2) // sensors
.any()
.compile();
@@ -149,7 +149,9 @@ public class FifotrackProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.PREFIX_ADC + (i + 1), Integer.parseInt(adc[i], 16));
}
- position.set(Position.KEY_DRIVER_UNIQUE_ID, parser.next());
+ if (parser.hasNext()) {
+ position.set(Position.KEY_DRIVER_UNIQUE_ID, String.valueOf(parser.nextHexInt()));
+ }
if (parser.hasNext()) {
String[] sensors = parser.next().split("\\|");