aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-12-28 07:52:24 -0800
committerAnton Tananaev <anton@traccar.org>2022-12-28 07:52:24 -0800
commit6c8fdbbf5f44db7eb88bc75dbaf89c679aa25cd5 (patch)
tree5d317d2757a1283d6a7bf019917ee7ea8263f5c0 /src/main/java/org/traccar
parent2e1b77d6aa5a2c2d2e07b29f80c40ec741004819 (diff)
downloadtrackermap-server-6c8fdbbf5f44db7eb88bc75dbaf89c679aa25cd5.tar.gz
trackermap-server-6c8fdbbf5f44db7eb88bc75dbaf89c679aa25cd5.tar.bz2
trackermap-server-6c8fdbbf5f44db7eb88bc75dbaf89c679aa25cd5.zip
Fix event and ignition
Diffstat (limited to 'src/main/java/org/traccar')
-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);