aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/H02FrameDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/H02FrameDecoder.java')
-rw-r--r--src/org/traccar/protocol/H02FrameDecoder.java6
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