diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-08-31 18:13:09 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-08-31 18:13:09 +1200 |
commit | c244a6c040ef8af247b08cb5ff25dfaac50aa1e5 (patch) | |
tree | ad6a6fed2afb1e1b4491a22fa51aebf675fcc1e8 /src | |
parent | af8aaaf1879957b83af1896dc9c1f72723bfe224 (diff) | |
download | traccar-server-c244a6c040ef8af247b08cb5ff25dfaac50aa1e5.tar.gz traccar-server-c244a6c040ef8af247b08cb5ff25dfaac50aa1e5.tar.bz2 traccar-server-c244a6c040ef8af247b08cb5ff25dfaac50aa1e5.zip |
Change GPS103 frame decoder
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/ServerManager.java | 10 |
1 files changed, 7 insertions, 3 deletions
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)); |