aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Gl200ProtocolDecoder.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-05-19 16:31:55 +0500
committerAbyss777 <abyss@fox5.ru>2017-05-19 16:31:55 +0500
commitab46ebf23066f91369b0d037f273bed1ea814d82 (patch)
tree5e7de0a5669fb22af0bd3d2b70a5847113d37f80 /src/org/traccar/protocol/Gl200ProtocolDecoder.java
parent9e758d437c048b954d224935664b76d6f6f8416c (diff)
downloadtrackermap-server-ab46ebf23066f91369b0d037f273bed1ea814d82.tar.gz
trackermap-server-ab46ebf23066f91369b0d037f273bed1ea814d82.tar.bz2
trackermap-server-ab46ebf23066f91369b0d037f273bed1ea814d82.zip
Fixed optional values
Diffstat (limited to 'src/org/traccar/protocol/Gl200ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Gl200ProtocolDecoder.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
index 081048a40..7e76fd6c9 100644
--- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
@@ -399,9 +399,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_BATTERY, parser.nextDouble(0));
position.set(Position.KEY_CHARGE, parser.nextInt(0) == 1);
- if (parser.hasNext()) {
- position.set(Position.KEY_BATTERY_LEVEL, parser.nextInt(0));
- }
+ position.set(Position.KEY_BATTERY_LEVEL, parser.nextInt());
position.set(Position.PREFIX_TEMP + 1, parser.next());
@@ -546,13 +544,13 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
}
position.set(Position.KEY_ODOMETER, parser.nextDouble(0) * 1000);
- position.set(Position.KEY_BATTERY_LEVEL, parser.nextInt(0));
+ position.set(Position.KEY_BATTERY_LEVEL, parser.nextInt());
position.set(Position.KEY_ODOMETER, parser.nextDouble(0) * 1000);
position.set(Position.KEY_HOURS, parser.next());
position.set(Position.PREFIX_ADC + 1, parser.next());
position.set(Position.PREFIX_ADC + 2, parser.next());
- position.set(Position.KEY_BATTERY_LEVEL, parser.nextInt(0));
+ position.set(Position.KEY_BATTERY_LEVEL, parser.nextInt());
decodeStatus(position, parser);
@@ -599,7 +597,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_HOURS, parser.next());
position.set(Position.PREFIX_ADC + 1, parser.next());
position.set(Position.PREFIX_ADC + 2, parser.next());
- position.set(Position.KEY_BATTERY_LEVEL, parser.nextInt(0));
+ position.set(Position.KEY_BATTERY_LEVEL, parser.nextInt());
decodeStatus(position, parser);