From c9b4dc5331b29fcc0bb9be35d132b1725662ca09 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 26 May 2018 17:09:39 +1200 Subject: Fix code check issues --- src/org/traccar/protocol/CautelaProtocolDecoder.java | 2 +- src/org/traccar/protocol/EasyTrackProtocolDecoder.java | 14 +++++++------- src/org/traccar/protocol/TaipProtocolDecoder.java | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/org/traccar/protocol/CautelaProtocolDecoder.java b/src/org/traccar/protocol/CautelaProtocolDecoder.java index d7bf4fb51..7c48ff690 100644 --- a/src/org/traccar/protocol/CautelaProtocolDecoder.java +++ b/src/org/traccar/protocol/CautelaProtocolDecoder.java @@ -51,7 +51,7 @@ public class CautelaProtocolDecoder extends BaseProtocolDecoder { return null; } - String type = parser.next(); + parser.next(); // type DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); if (deviceSession == null) { diff --git a/src/org/traccar/protocol/EasyTrackProtocolDecoder.java b/src/org/traccar/protocol/EasyTrackProtocolDecoder.java index 16ced37ae..efc69eca8 100644 --- a/src/org/traccar/protocol/EasyTrackProtocolDecoder.java +++ b/src/org/traccar/protocol/EasyTrackProtocolDecoder.java @@ -55,25 +55,25 @@ public class EasyTrackProtocolDecoder extends BaseProtocolDecoder { .compile(); private String decodeAlarm(long status) { - if ((status & 0x02000000) > 0) { + if ((status & 0x02000000) != 0) { return Position.ALARM_GEOFENCE_ENTER; } - if ((status & 0x04000000) > 0) { + if ((status & 0x04000000) != 0) { return Position.ALARM_GEOFENCE_EXIT; } - if ((status & 0x08000000) > 0) { + if ((status & 0x08000000) != 0) { return Position.ALARM_LOW_BATTERY; } - if ((status & 0x20000000) > 0) { + if ((status & 0x20000000) != 0) { return Position.ALARM_VIBRATION; } - if ((status & 0x80000000) > 0) { + if ((status & 0x80000000) != 0) { return Position.ALARM_OVERSPEED; } - if ((status & 0x00010000) > 0) { + if ((status & 0x00010000) != 0) { return Position.ALARM_SOS; } - if ((status & 0x00040000) > 0) { + if ((status & 0x00040000) != 0) { return Position.ALARM_POWER_CUT; } return null; diff --git a/src/org/traccar/protocol/TaipProtocolDecoder.java b/src/org/traccar/protocol/TaipProtocolDecoder.java index a7aa9dd96..ea5492462 100644 --- a/src/org/traccar/protocol/TaipProtocolDecoder.java +++ b/src/org/traccar/protocol/TaipProtocolDecoder.java @@ -178,7 +178,7 @@ public class TaipProtocolDecoder extends BaseProtocolDecoder { position.set(Position.PREFIX_TEMP + 2, parser.nextInt() * 0.01); } - position.setValid(valid != null ? valid : true); + position.setValid(valid == null || valid); if (event != null) { position.set(Position.KEY_EVENT, event); -- cgit v1.2.3