diff options
author | Nikolay Vlahovski <nvlahovski@gmail.com> | 2023-05-17 20:29:37 +0300 |
---|---|---|
committer | Nikolay Vlahovski <nvlahovski@gmail.com> | 2023-05-17 20:29:37 +0300 |
commit | 074dc016d21f9848140d125c2812d8abf25e8d53 (patch) | |
tree | 4c33c4438b0a055024bafca19c6dc3fdf74ea1f4 | |
parent | 34f6dfbf1d2c48ae932fa7565dd30d2817d2c1f9 (diff) | |
download | trackermap-server-074dc016d21f9848140d125c2812d8abf25e8d53.tar.gz trackermap-server-074dc016d21f9848140d125c2812d8abf25e8d53.tar.bz2 trackermap-server-074dc016d21f9848140d125c2812d8abf25e8d53.zip |
Fix Pythonic ussues
-rw-r--r-- | src/main/java/org/traccar/protocol/TranSyncProtocol.java | 2 | ||||
-rw-r--r-- | src/main/java/org/traccar/protocol/TranSyncProtocolDecoder.java | 16 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/main/java/org/traccar/protocol/TranSyncProtocol.java b/src/main/java/org/traccar/protocol/TranSyncProtocol.java index 3abe05de8..5422380b6 100644 --- a/src/main/java/org/traccar/protocol/TranSyncProtocol.java +++ b/src/main/java/org/traccar/protocol/TranSyncProtocol.java @@ -35,4 +35,4 @@ public class TranSyncProtocol extends BaseProtocol { } }); } -}
\ No newline at end of file +} diff --git a/src/main/java/org/traccar/protocol/TranSyncProtocolDecoder.java b/src/main/java/org/traccar/protocol/TranSyncProtocolDecoder.java index acb46ec48..1b7c9539c 100644 --- a/src/main/java/org/traccar/protocol/TranSyncProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/TranSyncProtocolDecoder.java @@ -35,7 +35,7 @@ public class TranSyncProtocolDecoder extends BaseProtocolDecoder { private static final byte[] STX = new byte[]{0x3a, 0x3a}; - private String getHardwareType(int type){ + private String getHardwareType(int type) { switch (type) { case 1: @@ -107,22 +107,28 @@ public class TranSyncProtocolDecoder extends BaseProtocolDecoder { case 5: position.set(Position.KEY_EVENT, 5); break; + default: + position.set(Position.KEY_EVENT, "unknown"); } } - private void decodePowerEngineParameters(Position position, int value){ + private void decodePowerEngineParameters(Position position, int value) { position.set(Position.PREFIX_OUT + 1, BitUtil.check(value, 7)); position.set(Position.PREFIX_OUT + 2, BitUtil.check(value, 6)); position.set(Position.PREFIX_IN + 3, BitUtil.check(value, 5)); - if (BitUtil.check(value, 4)) position.set(Position.KEY_ALARM, Position.ALARM_POWER_OFF); + if (BitUtil.check(value, 4)) { + position.set(Position.KEY_ALARM, Position.ALARM_POWER_OFF); + } position.set(Position.KEY_IGNITION, BitUtil.check(value, 3)); position.set("gpsFix", BitUtil.check(value, 0)); } - private void decodeTrackerStatusParameters(Position position, int value){ - if (BitUtil.check(value, 7)) position.set(Position.KEY_ARCHIVE, true); + private void decodeTrackerStatusParameters(Position position, int value) { + if (BitUtil.check(value, 7)) { + position.set(Position.KEY_ARCHIVE, true); + } if (BitUtil.check(value, 5)) { position.set(Position.KEY_ALARM, Position.ALARM_GPS_ANTENNA_CUT); } |