diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-07-27 14:25:33 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-07-27 14:25:33 +1200 |
commit | cf6440ef1ae4f68dc0cdcb1579f9347a938d8675 (patch) | |
tree | 9a1f95881492da97d195b677a8331cc76011a35a /src/org/traccar/protocol/SuntechProtocol.java | |
parent | ba7c66163bc0d22a9c1939f2bb0f47e85cfffb9d (diff) | |
download | trackermap-server-cf6440ef1ae4f68dc0cdcb1579f9347a938d8675.tar.gz trackermap-server-cf6440ef1ae4f68dc0cdcb1579f9347a938d8675.tar.bz2 trackermap-server-cf6440ef1ae4f68dc0cdcb1579f9347a938d8675.zip |
Implement Suntech commands support
Diffstat (limited to 'src/org/traccar/protocol/SuntechProtocol.java')
-rw-r--r-- | src/org/traccar/protocol/SuntechProtocol.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/SuntechProtocol.java b/src/org/traccar/protocol/SuntechProtocol.java index 630cab971..d3f5d6009 100644 --- a/src/org/traccar/protocol/SuntechProtocol.java +++ b/src/org/traccar/protocol/SuntechProtocol.java @@ -18,9 +18,11 @@ 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.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; +import org.traccar.model.Command; import java.util.List; @@ -28,6 +30,9 @@ public class SuntechProtocol extends BaseProtocol { public SuntechProtocol() { super("suntech"); + setSupportedCommands( + Command.TYPE_ENGINE_STOP, + Command.TYPE_ENGINE_STOP); } @Override @@ -37,7 +42,9 @@ public class SuntechProtocol extends BaseProtocol { protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '\r')); pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("stringEncoder", new StringEncoder()); pipeline.addLast("objectDecoder", new SuntechProtocolDecoder(SuntechProtocol.this)); + pipeline.addLast("objectEncoder", new SuntechProtocolEncoder()); } }); } |