aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-11-06 06:38:30 -0800
committerAnton Tananaev <anton@traccar.org>2023-11-06 06:38:30 -0800
commit1b7802c639f8d40db141429f2c15b96e3b743a04 (patch)
treeb954fa7ce02aefdded9efb939d1934d6cbc0eb2d /src/main
parent3860e965c9feede1ac876261a47370b44181b5d7 (diff)
downloadtrackermap-server-1b7802c639f8d40db141429f2c15b96e3b743a04.tar.gz
trackermap-server-1b7802c639f8d40db141429f2c15b96e3b743a04.tar.bz2
trackermap-server-1b7802c639f8d40db141429f2c15b96e3b743a04.zip
Fix device id decoding
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/PositrexProtocolDecoder.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/PositrexProtocolDecoder.java b/src/main/java/org/traccar/protocol/PositrexProtocolDecoder.java
index 8726bc831..ff4825e8d 100644
--- a/src/main/java/org/traccar/protocol/PositrexProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/PositrexProtocolDecoder.java
@@ -59,12 +59,11 @@ public class PositrexProtocolDecoder extends BaseProtocolDecoder {
ByteBuf buf = (ByteBuf) msg;
int first = buf.getUnsignedByte(buf.readerIndex());
- int second = buf.getUnsignedByte(buf.readerIndex() + 1);
long deviceId;
if (BitUtil.check(first, 7)) {
if (BitUtil.check(first, 6)) {
deviceId = 73000000 + BitUtil.to(buf.readUnsignedInt(), 30);
- } else if (second == 0) {
+ } else if (!BitUtil.check(first, 5) && !BitUtil.check(first, 4)) {
deviceId = 7590000 + BitUtil.to(buf.readUnsignedMedium(), 20);
} else {
deviceId = 70000000 + BitUtil.to(buf.readUnsignedMedium(), 20);