aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/L100FrameDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-04-28 16:08:40 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-04-28 16:08:40 +1200
commitc763c6c688a2148e46c951c9fc33c09e640bcd9d (patch)
treeb259117ab656c5c473ef3b0d4d6bf4598b226723 /src/org/traccar/protocol/L100FrameDecoder.java
parent7e121784cc9fc79d058f2bdc5bd631a027e7c455 (diff)
downloadtrackermap-server-c763c6c688a2148e46c951c9fc33c09e640bcd9d.tar.gz
trackermap-server-c763c6c688a2148e46c951c9fc33c09e640bcd9d.tar.bz2
trackermap-server-c763c6c688a2148e46c951c9fc33c09e640bcd9d.zip
Refactor L100 protocol for Atlanta devices
Diffstat (limited to 'src/org/traccar/protocol/L100FrameDecoder.java')
-rw-r--r--src/org/traccar/protocol/L100FrameDecoder.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/L100FrameDecoder.java b/src/org/traccar/protocol/L100FrameDecoder.java
index a597cbd7d..98c2f9768 100644
--- a/src/org/traccar/protocol/L100FrameDecoder.java
+++ b/src/org/traccar/protocol/L100FrameDecoder.java
@@ -41,7 +41,10 @@ public class L100FrameDecoder extends FrameDecoder {
index += 2; // checksum
if (buf.readableBytes() >= index - buf.readerIndex()) {
- return buf.readBytes(index - buf.readerIndex());
+ buf.skipBytes(2); // header
+ ChannelBuffer frame = buf.readBytes(index - buf.readerIndex() - 2);
+ buf.skipBytes(2); // footer
+ return frame;
}
return null;