aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/CellocatorProtocolDecoder.java
diff options
context:
space:
mode:
authorYuriy Piskarev <yuriy.piskarev@gmail.com>2023-08-24 14:16:17 +0300
committerGitHub <noreply@github.com>2023-08-24 14:16:17 +0300
commitae406c7b49a72de24d81fd74386d9638342c90ee (patch)
tree6fbcf557375b98e926c78af9c757e62c79d72a1b /src/main/java/org/traccar/protocol/CellocatorProtocolDecoder.java
parent56ff656c908b19feb2fa3dcffa48cc3bcdfe9b3b (diff)
parent9aeedc90da24848ff97227d6f281eb4d1e1506ef (diff)
downloadtrackermap-server-ae406c7b49a72de24d81fd74386d9638342c90ee.tar.gz
trackermap-server-ae406c7b49a72de24d81fd74386d9638342c90ee.tar.bz2
trackermap-server-ae406c7b49a72de24d81fd74386d9638342c90ee.zip
Merge branch 'traccar:master' into master
Diffstat (limited to 'src/main/java/org/traccar/protocol/CellocatorProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/CellocatorProtocolDecoder.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/org/traccar/protocol/CellocatorProtocolDecoder.java b/src/main/java/org/traccar/protocol/CellocatorProtocolDecoder.java
index 09bd3572f..3573a95ca 100644
--- a/src/main/java/org/traccar/protocol/CellocatorProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/CellocatorProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013 - 2019 Anton Tananaev (anton@traccar.org)
+ * Copyright 2013 - 2022 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@ import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
-import org.traccar.DeviceSession;
+import org.traccar.session.DeviceSession;
import org.traccar.NetworkMessage;
import org.traccar.Protocol;
import org.traccar.helper.BitUtil;
@@ -120,13 +120,15 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedByte(); // operator / configuration flags
buf.readUnsignedByte(); // reason data
- position.set(Position.KEY_ALARM, decodeAlarm(buf.readUnsignedByte()));
+ 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);