aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-11-13 10:09:06 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2018-11-13 10:09:25 +1300
commita789d3992ec5c5918a122c284fe46e4f1e26b746 (patch)
treefd1fd60b42b87e9344e4244284dba3a7e98d63b7 /src/org
parent8abf4f011eef72e06dd24720e00ce27350b0b047 (diff)
downloadtrackermap-server-a789d3992ec5c5918a122c284fe46e4f1e26b746.tar.gz
trackermap-server-a789d3992ec5c5918a122c284fe46e4f1e26b746.tar.bz2
trackermap-server-a789d3992ec5c5918a122c284fe46e4f1e26b746.zip
Handle ST600 empty values
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/SuntechProtocolDecoder.java8
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) {