diff options
Diffstat (limited to 'src/main/java/org/traccar/protocol/CellocatorFrameDecoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/CellocatorFrameDecoder.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/CellocatorFrameDecoder.java b/src/main/java/org/traccar/protocol/CellocatorFrameDecoder.java index 7d5499d92..ee2adde6d 100644 --- a/src/main/java/org/traccar/protocol/CellocatorFrameDecoder.java +++ b/src/main/java/org/traccar/protocol/CellocatorFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2018 Anton Tananaev (anton@traccar.org) + * Copyright 2013 - 2019 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. @@ -46,11 +46,14 @@ public class CellocatorFrameDecoder extends BaseFrameDecoder { break; case CellocatorProtocolDecoder.MSG_CLIENT_SERIAL: if (buf.readableBytes() >= 19) { - length = 19 + buf.getUnsignedShortLE(16); + length = 19 + buf.getUnsignedShortLE(buf.readerIndex() + 16); } break; case CellocatorProtocolDecoder.MSG_CLIENT_MODULAR: - length = 15 + buf.getUnsignedByte(13); + length = 15 + buf.getUnsignedByte(buf.readerIndex() + 13); + break; + case CellocatorProtocolDecoder.MSG_CLIENT_MODULAR_EXT: + length = 16 + buf.getUnsignedShortLE(buf.readerIndex() + 13); break; default: break; |