diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-10-23 22:34:53 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-10-23 22:34:53 +1300 |
commit | 1928609c0f6e6cd78a4788a7d3fe2f37f32ead33 (patch) | |
tree | aa2847d3cbb9e60705be4d5c682c38b5fb9b8457 /src/org/traccar/protocol/H02FrameDecoder.java | |
parent | 30ebfa7d6b683fcec586233fa5c68a966c2841ad (diff) | |
download | trackermap-server-1928609c0f6e6cd78a4788a7d3fe2f37f32ead33.tar.gz trackermap-server-1928609c0f6e6cd78a4788a7d3fe2f37f32ead33.tar.bz2 trackermap-server-1928609c0f6e6cd78a4788a7d3fe2f37f32ead33.zip |
Improve H02 decoders
Diffstat (limited to 'src/org/traccar/protocol/H02FrameDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/H02FrameDecoder.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/H02FrameDecoder.java b/src/org/traccar/protocol/H02FrameDecoder.java index ef28e9986..82e3201f7 100644 --- a/src/org/traccar/protocol/H02FrameDecoder.java +++ b/src/org/traccar/protocol/H02FrameDecoder.java @@ -33,6 +33,12 @@ public class H02FrameDecoder extends FrameDecoder { ChannelBuffer buf) throws Exception { String marker = buf.toString(buf.readerIndex(), 1, Charset.defaultCharset()); + + while ((marker.equals(" ") || marker.equals("\r") || marker.equals("\n")) && buf.readableBytes() > 0) { + buf.skipBytes(1); + marker = buf.toString(buf.readerIndex(), 1, Charset.defaultCharset()); + } + if (marker.equals("*")) { // Return text message |