diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/protocol/SuntechProtocolDecoder.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/SuntechProtocolDecoder.java b/src/org/traccar/protocol/SuntechProtocolDecoder.java index 48eb3a71d..ad1da537b 100644 --- a/src/org/traccar/protocol/SuntechProtocolDecoder.java +++ b/src/org/traccar/protocol/SuntechProtocolDecoder.java @@ -317,9 +317,11 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder { } if (includeAdc) { - position.set(Position.PREFIX_ADC + 1, Double.parseDouble(values[index++])); - position.set(Position.PREFIX_ADC + 2, Double.parseDouble(values[index++])); - position.set(Position.PREFIX_ADC + 3, Double.parseDouble(values[index++])); + for (int i = 1; i <= 3; i++) { + if (!values[index++].isEmpty()) { + position.set(Position.PREFIX_ADC + i, Double.parseDouble(values[index - 1])); + } + } } if (values.length - index >= 2) { |