aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-01-06 23:36:55 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2019-01-06 23:36:55 -0800
commit90a88ff7584c9d4200f2a32800bf6eaf417955ac (patch)
tree788eaf50c893b10ff0cce28640801f3e64e17adc /src/org/traccar/protocol
parentacaf8a43c33ec97e4553b806a486fd79c93a316d (diff)
downloadtraccar-server-90a88ff7584c9d4200f2a32800bf6eaf417955ac.tar.gz
traccar-server-90a88ff7584c9d4200f2a32800bf6eaf417955ac.tar.bz2
traccar-server-90a88ff7584c9d4200f2a32800bf6eaf417955ac.zip
Decode Atrack driver id
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/AtrackProtocolDecoder.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/AtrackProtocolDecoder.java b/src/org/traccar/protocol/AtrackProtocolDecoder.java
index 1963763ed..71bb6791c 100644
--- a/src/org/traccar/protocol/AtrackProtocolDecoder.java
+++ b/src/org/traccar/protocol/AtrackProtocolDecoder.java
@@ -381,7 +381,7 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder {
.number("(d+),") // speed
.number("(d+),") // outputs
.number("(d+),") // adc
- .number("[^,]*,") // driver
+ .number("([^,]+)?,") // driver
.number("(d+),") // temp1
.number("(d+),") // temp2
.expression("[^,]*,") // text message
@@ -455,6 +455,11 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_OUTPUT, parser.nextInt());
position.set(Position.PREFIX_ADC + 1, parser.nextInt());
+
+ if (parser.hasNext()) {
+ position.set(Position.KEY_DRIVER_UNIQUE_ID, parser.next());
+ }
+
position.set(Position.PREFIX_TEMP + 1, parser.nextInt());
position.set(Position.PREFIX_TEMP + 2, parser.nextInt());