aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/CellocatorProtocolDecoder.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/protocol/CellocatorProtocolDecoder.java b/src/main/java/org/traccar/protocol/CellocatorProtocolDecoder.java
index 07f7f1692..3573a95ca 100644
--- a/src/main/java/org/traccar/protocol/CellocatorProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/CellocatorProtocolDecoder.java
@@ -119,14 +119,16 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_STATUS, buf.readUnsignedByte() & 0x0f);
buf.readUnsignedByte(); // operator / configuration flags
- position.set(Position.KEY_EVENT, buf.readUnsignedByte());
- position.set(Position.KEY_ALARM, decodeAlarm(buf.readUnsignedByte()));
+ buf.readUnsignedByte(); // reason data
+ short event = buf.readUnsignedByte();
+ position.set(Position.KEY_ALARM, decodeAlarm(event));
+ position.set(Position.KEY_EVENT, event);
position.set("mode", buf.readUnsignedByte());
- long input = buf.readUnsignedIntLE();
+ long input = buf.readUnsignedInt();
+ position.set(Position.KEY_IGNITION, BitUtil.check(input, 3 * 8 + 5));
position.set(Position.KEY_DOOR, BitUtil.check(input, 3 * 8));
- position.set(Position.KEY_IGNITION, BitUtil.check(input, 2 * 8 + 7));
position.set(Position.KEY_CHARGE, BitUtil.check(input, 7));
position.set(Position.KEY_INPUT, input);