diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-11-13 10:09:06 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-11-13 10:09:25 +1300 |
commit | a789d3992ec5c5918a122c284fe46e4f1e26b746 (patch) | |
tree | fd1fd60b42b87e9344e4244284dba3a7e98d63b7 /src | |
parent | 8abf4f011eef72e06dd24720e00ce27350b0b047 (diff) | |
download | traccar-server-a789d3992ec5c5918a122c284fe46e4f1e26b746.tar.gz traccar-server-a789d3992ec5c5918a122c284fe46e4f1e26b746.tar.bz2 traccar-server-a789d3992ec5c5918a122c284fe46e4f1e26b746.zip |
Handle ST600 empty values
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) { |