diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-06-07 17:12:01 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-06-07 17:12:01 -0700 |
commit | d6e9efc48fca16263d6ac50aa063b1da8f14b125 (patch) | |
tree | 0f28d37449cff1e7ccb130571692e53ad41f5611 /src/org/traccar/protocol/AtrackProtocol.java | |
parent | 2742be4523fab5b371ae5dc11f573c7064546a7f (diff) | |
download | trackermap-server-d6e9efc48fca16263d6ac50aa063b1da8f14b125.tar.gz trackermap-server-d6e9efc48fca16263d6ac50aa063b1da8f14b125.tar.bz2 trackermap-server-d6e9efc48fca16263d6ac50aa063b1da8f14b125.zip |
Custom Atrack commands encoding
Diffstat (limited to 'src/org/traccar/protocol/AtrackProtocol.java')
-rw-r--r-- | src/org/traccar/protocol/AtrackProtocol.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/AtrackProtocol.java b/src/org/traccar/protocol/AtrackProtocol.java index 2ab33ea6d..5104e5587 100644 --- a/src/org/traccar/protocol/AtrackProtocol.java +++ b/src/org/traccar/protocol/AtrackProtocol.java @@ -20,6 +20,7 @@ import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; +import org.traccar.model.Command; import java.util.List; @@ -27,6 +28,8 @@ public class AtrackProtocol extends BaseProtocol { public AtrackProtocol() { super("atrack"); + setSupportedDataCommands( + Command.TYPE_CUSTOM); } @Override @@ -35,12 +38,14 @@ public class AtrackProtocol extends BaseProtocol { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new AtrackFrameDecoder()); + pipeline.addLast("objectEncoder", new AtrackProtocolEncoder()); pipeline.addLast("objectDecoder", new AtrackProtocolDecoder(AtrackProtocol.this)); } }); serverList.add(new TrackerServer(new ConnectionlessBootstrap(), getName()) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { + pipeline.addLast("objectEncoder", new AtrackProtocolEncoder()); pipeline.addLast("objectDecoder", new AtrackProtocolDecoder(AtrackProtocol.this)); } }); |