aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-07-05 19:06:26 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-07-05 19:06:26 -0700
commit64a84fcb0a61d2a4cdb0d329f309cc0af3339e93 (patch)
treee9bfbcca69d9b5854dc71bc6131e5790edc3637e /src/main/java/org/traccar/protocol
parent8c4ea5c2b3006f02ed371d5ef026d0f57e7aefed (diff)
downloadtraccar-server-64a84fcb0a61d2a4cdb0d329f309cc0af3339e93.tar.gz
traccar-server-64a84fcb0a61d2a4cdb0d329f309cc0af3339e93.tar.bz2
traccar-server-64a84fcb0a61d2a4cdb0d329f309cc0af3339e93.zip
Fix analysis issues
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r--src/main/java/org/traccar/protocol/PacificTrackProtocolDecoder.java1
-rw-r--r--src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java6
2 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/protocol/PacificTrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/PacificTrackProtocolDecoder.java
index b1c13d486..846b33396 100644
--- a/src/main/java/org/traccar/protocol/PacificTrackProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/PacificTrackProtocolDecoder.java
@@ -91,6 +91,7 @@ public class PacificTrackProtocolDecoder extends BaseProtocolDecoder {
switch (BitUtil.between(field, 2, 5)) {
case 0b000:
position.set("bus", BitUtil.to(field, 2));
+ break;
case 0b001:
position.set("currentGear", BitUtil.to(field, 2));
break;
diff --git a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java
index 3d6f5b8a5..5472b272d 100644
--- a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java
@@ -667,10 +667,8 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedShort(); // alert modifier
}
- if (BitUtil.check(mask, 21)) {
- if (alertId == 59) {
- position.set(Position.KEY_DRIVER_UNIQUE_ID, ByteBufUtil.hexDump(buf.readSlice(8)));
- }
+ if (BitUtil.check(mask, 21) && alertId == 59) {
+ position.set(Position.KEY_DRIVER_UNIQUE_ID, ByteBufUtil.hexDump(buf.readSlice(8)));
}
return position;