From 22a5358b7b8f15ac8a3ac3ac050f7804e9d83938 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 11 Dec 2019 00:24:08 -0800 Subject: Fix state decoding --- src/main/java/org/traccar/protocol/CastelProtocolDecoder.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/traccar/protocol/CastelProtocolDecoder.java b/src/main/java/org/traccar/protocol/CastelProtocolDecoder.java index 53a66af27..23401b5ee 100644 --- a/src/main/java/org/traccar/protocol/CastelProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/CastelProtocolDecoder.java @@ -188,10 +188,10 @@ public class CastelProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedShortLE(); // current fuel consumption long state = buf.readUnsignedIntLE(); - position.set(Position.KEY_IGNITION, BitUtil.check(state, 8 + 2)); - position.set(Position.KEY_ALARM, BitUtil.check(state, 3 * 8 + 4) ? Position.ALARM_ACCELERATION : null); - position.set(Position.KEY_ALARM, BitUtil.check(state, 3 * 8 + 5) ? Position.ALARM_BRAKING : null); - position.set(Position.KEY_ALARM, BitUtil.check(state, 3 * 8 + 6) ? Position.ALARM_IDLE : null); + position.set(Position.KEY_ALARM, BitUtil.check(state, 4) ? Position.ALARM_ACCELERATION : null); + position.set(Position.KEY_ALARM, BitUtil.check(state, 5) ? Position.ALARM_BRAKING : null); + position.set(Position.KEY_ALARM, BitUtil.check(state, 6) ? Position.ALARM_IDLE : null); + position.set(Position.KEY_IGNITION, BitUtil.check(state, 2 * 8 + 2)); position.set(Position.KEY_STATUS, state); buf.skipBytes(8); -- cgit v1.2.3