From 5e8dbc78110ab5e28d1d57277a38dd1991dba0e6 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Wed, 24 Aug 2016 09:54:21 +0500 Subject: - Fixed optional odometer for wondex protocol - Do not use zero odometer values to calculateDistance --- src/org/traccar/protocol/WondexProtocolDecoder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/org/traccar/protocol') 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()); -- cgit v1.2.3