aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/WondexProtocolDecoder.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-08-24 09:54:21 +0500
committerAbyss777 <abyss@fox5.ru>2016-08-24 09:54:21 +0500
commit5e8dbc78110ab5e28d1d57277a38dd1991dba0e6 (patch)
tree0491a9542e632741ce070aae1aa87a4decfeda88 /src/org/traccar/protocol/WondexProtocolDecoder.java
parentea0bdea88003f46fd6f6164d5c45e33d53f47c81 (diff)
downloadtrackermap-server-5e8dbc78110ab5e28d1d57277a38dd1991dba0e6.tar.gz
trackermap-server-5e8dbc78110ab5e28d1d57277a38dd1991dba0e6.tar.bz2
trackermap-server-5e8dbc78110ab5e28d1d57277a38dd1991dba0e6.zip
- Fixed optional odometer for wondex protocol
- Do not use zero odometer values to calculateDistance
Diffstat (limited to 'src/org/traccar/protocol/WondexProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/WondexProtocolDecoder.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/WondexProtocolDecoder.java b/src/org/traccar/protocol/WondexProtocolDecoder.java
index 97426d78c..0fcb99578 100644
--- a/src/org/traccar/protocol/WondexProtocolDecoder.java
+++ b/src/org/traccar/protocol/WondexProtocolDecoder.java
@@ -115,7 +115,9 @@ public class WondexProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_EVENT, parser.next());
position.set(Position.KEY_BATTERY, parser.next());
- position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000);
+ if (parser.hasNext()) {
+ position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000);
+ }
position.set(Position.KEY_INPUT, parser.next());
position.set(Position.PREFIX_ADC + 1, parser.next());
position.set(Position.PREFIX_ADC + 2, parser.next());