aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-12-11 00:24:08 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2019-12-11 00:24:08 -0800
commit22a5358b7b8f15ac8a3ac3ac050f7804e9d83938 (patch)
tree568a38dbdab632eab0cb64717700409680b4358f
parent7cfae9b852f147423b7dd58bad2b0fdcf10bb9d0 (diff)
downloadtrackermap-server-22a5358b7b8f15ac8a3ac3ac050f7804e9d83938.tar.gz
trackermap-server-22a5358b7b8f15ac8a3ac3ac050f7804e9d83938.tar.bz2
trackermap-server-22a5358b7b8f15ac8a3ac3ac050f7804e9d83938.zip
Fix state decoding
-rw-r--r--src/main/java/org/traccar/protocol/CastelProtocolDecoder.java8
1 files 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);