aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/protocol/Gt06ProtocolDecoder.java4
-rw-r--r--src/org/traccar/protocol/SuntechProtocolDecoder.java6
2 files changed, 3 insertions, 7 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
index ec3cec533..6c164386d 100644
--- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -155,9 +155,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
return false;
}
- int length = buf.readUnsignedByte();
- position.set(Position.KEY_SATELLITES, BitUtil.to(length, 4));
- length = BitUtil.from(length, 4);
+ position.set(Position.KEY_SATELLITES, BitUtil.to(buf.readUnsignedByte(), 4));
double latitude = buf.readUnsignedInt() / 60.0 / 30000.0;
double longitude = buf.readUnsignedInt() / 60.0 / 30000.0;
diff --git a/src/org/traccar/protocol/SuntechProtocolDecoder.java b/src/org/traccar/protocol/SuntechProtocolDecoder.java
index ec764774d..68c920899 100644
--- a/src/org/traccar/protocol/SuntechProtocolDecoder.java
+++ b/src/org/traccar/protocol/SuntechProtocolDecoder.java
@@ -176,10 +176,8 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_BATTERY, Double.parseDouble(values[index++]));
}
- if (index < values.length) {
- if (values[index++].equals("0")) {
- position.set(Position.KEY_ARCHIVE, true);
- }
+ if (index < values.length && values[index++].equals("0")) {
+ position.set(Position.KEY_ARCHIVE, true);
}
if (includeAdc) {