diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-11-02 06:21:30 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-11-02 06:21:30 +1300 |
commit | 262069d02c8fa1a5848fab749a617bc53b928c70 (patch) | |
tree | 8a4703a73876088b90c35e11bada3accf58cb557 /src/org/traccar/protocol/Tk102Protocol.java | |
parent | 70a3fd581b79556b3feb083d79228384efdf66d2 (diff) | |
download | trackermap-server-262069d02c8fa1a5848fab749a617bc53b928c70.tar.gz trackermap-server-262069d02c8fa1a5848fab749a617bc53b928c70.tar.bz2 trackermap-server-262069d02c8fa1a5848fab749a617bc53b928c70.zip |
Change TK102 protocol to binary
Diffstat (limited to 'src/org/traccar/protocol/Tk102Protocol.java')
-rw-r--r-- | src/org/traccar/protocol/Tk102Protocol.java | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/org/traccar/protocol/Tk102Protocol.java b/src/org/traccar/protocol/Tk102Protocol.java index 7310d23bd..ad3d8affa 100644 --- a/src/org/traccar/protocol/Tk102Protocol.java +++ b/src/org/traccar/protocol/Tk102Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,10 +17,8 @@ package org.traccar.protocol; import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; -import org.jboss.netty.handler.codec.string.StringDecoder; -import org.jboss.netty.handler.codec.string.StringEncoder; +import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; import org.traccar.BaseProtocol; -import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; import java.util.List; @@ -36,9 +34,7 @@ public class Tk102Protocol extends BaseProtocol { serverList.add(new TrackerServer(new ServerBootstrap(), getName()) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, ']')); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 1 + 1 + 10, 1, 1, 0)); pipeline.addLast("objectDecoder", new Tk102ProtocolDecoder(Tk102Protocol.this)); } }); |