aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/AdmProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/protocol/AdmProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/AdmProtocolDecoder.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/AdmProtocolDecoder.java b/src/main/java/org/traccar/protocol/AdmProtocolDecoder.java
index 52d1439ed..31064286e 100644
--- a/src/main/java/org/traccar/protocol/AdmProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/AdmProtocolDecoder.java
@@ -178,6 +178,10 @@ public class AdmProtocolDecoder extends BaseProtocolDecoder {
protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
ByteBuf buf = (ByteBuf) msg;
+ if (Character.isDigit(buf.getUnsignedByte(buf.readerIndex()))) {
+ getDeviceSession(channel, remoteAddress, buf.readSlice(15).toString(StandardCharsets.UTF_8));
+ }
+
buf.readUnsignedShortLE(); // device id
int size = buf.readUnsignedByte();