From c244a6c040ef8af247b08cb5ff25dfaac50aa1e5 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 31 Aug 2013 18:13:09 +1200 Subject: Change GPS103 frame decoder --- src/org/traccar/ServerManager.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/org') diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java index 46346f1c1..ab81caafd 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -224,9 +224,13 @@ public class ServerManager { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { - byte delimiter[] = { (byte) ';' }; - pipeline.addLast("frameDecoder", - new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); + byte delimiter1[] = { (byte) '\r', (byte) '\n' }; + byte delimiter2[] = { (byte) '\n' }; + byte delimiter3[] = { (byte) ';' }; + pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, + ChannelBuffers.wrappedBuffer(delimiter1), + ChannelBuffers.wrappedBuffer(delimiter2), + ChannelBuffers.wrappedBuffer(delimiter3))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); pipeline.addLast("objectDecoder", new Gps103ProtocolDecoder(ServerManager.this)); -- cgit v1.2.3