diff options
author | Matjaž Črnko <m.crnko@txt.si> | 2021-10-20 20:39:16 +0200 |
---|---|---|
committer | Matjaž Črnko <m.crnko@txt.si> | 2021-10-20 20:39:16 +0200 |
commit | b4de72d4a0bf73998224d08a3bd2ba8310d83f8d (patch) | |
tree | 5242671a8082185b6ca6c58aa7ab3c0e85ade00f /src | |
parent | 3c52988d6549dfd271693096bbf86ed17e532737 (diff) | |
download | traccar-server-b4de72d4a0bf73998224d08a3bd2ba8310d83f8d.tar.gz traccar-server-b4de72d4a0bf73998224d08a3bd2ba8310d83f8d.tar.bz2 traccar-server-b4de72d4a0bf73998224d08a3bd2ba8310d83f8d.zip |
fix: Totem - remove individual bit decoding and store the whole status in KEY_STATUS
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/traccar/protocol/TotemProtocolDecoder.java | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/src/main/java/org/traccar/protocol/TotemProtocolDecoder.java b/src/main/java/org/traccar/protocol/TotemProtocolDecoder.java index 1d4100932..81948f16d 100644 --- a/src/main/java/org/traccar/protocol/TotemProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/TotemProtocolDecoder.java @@ -372,31 +372,16 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_ALARM, BitUtil.check(status, 32 - 5) ? Position.ALARM_GEOFENCE_EXIT : null); position.set(Position.KEY_ALARM, BitUtil.check(status, 32 - 6) ? Position.ALARM_GEOFENCE_ENTER : null); position.set(Position.KEY_ALARM, BitUtil.check(status, 32 - 7) ? Position.ALARM_GPS_ANTENNA_CUT : null); - position.set(Position.PREFIX_IO + 8, BitUtil.check(status, 32 - 8)); // GPS Module Error position.set(Position.PREFIX_OUT + 1, BitUtil.check(status, 32 - 9)); position.set(Position.PREFIX_OUT + 2, BitUtil.check(status, 32 - 10)); position.set(Position.PREFIX_OUT + 3, BitUtil.check(status, 32 - 11)); /** * Different Devices have different meaning for bits 12-22 - * But unfortunately we cannot reliably detect this, so we use generic IO<bit> notation - * - * | AT05 | AT07 | AT09 - * 12 | Reserved | IN2 | OUT4 - * 13 | IN2 | IN4 | IN2 - * 14 | IN3 | Shock | IN3 - * 15 | IN4 | Idle | IN4 - * 16 | Shock | Low Batt. | Shock - * 17 | Idle | Drv. Auth. | Idle - * 18 | Low Batt. | GPS Status | Low Batt. - * 19 | Drv. Auth. | Batt. chrg.| Drv. Auth. - * 20 | GPS Status | GSM Jamming| GPS Status - * 21 | Batt. chrg.| Reserved | Batt. chrg. - * 22 | Reserved | Reserved | GSM Jamming + * But unfortunately we cannot reliably detect this, so we store the whole status in KEY_STATUS + * See: https://github.com/traccar/traccar/pull/4762 */ - for (int i = 12; i < 23; i++) { - position.set(Position.PREFIX_IO + i, BitUtil.check(status, 32 - i)); - } + position.set(Position.KEY_STATUS, status); position.setTime(parser.nextDateTime()); |