diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-01-06 23:36:55 -0800 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2019-01-06 23:36:55 -0800 |
commit | 90a88ff7584c9d4200f2a32800bf6eaf417955ac (patch) | |
tree | 788eaf50c893b10ff0cce28640801f3e64e17adc /src/org/traccar/protocol/AtrackProtocolDecoder.java | |
parent | acaf8a43c33ec97e4553b806a486fd79c93a316d (diff) | |
download | trackermap-server-90a88ff7584c9d4200f2a32800bf6eaf417955ac.tar.gz trackermap-server-90a88ff7584c9d4200f2a32800bf6eaf417955ac.tar.bz2 trackermap-server-90a88ff7584c9d4200f2a32800bf6eaf417955ac.zip |
Decode Atrack driver id
Diffstat (limited to 'src/org/traccar/protocol/AtrackProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/AtrackProtocolDecoder.java | 7 |
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()); |