aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/KhdProtocol.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-08-31 16:36:04 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-08-31 16:36:04 +1200
commit142734931830f117b0e86dfa5f6dddec5416d878 (patch)
treec549452fc812896789786a090c4f38983d048d10 /src/org/traccar/protocol/KhdProtocol.java
parent82872aacbbc0a1a0b7e76481055164b435422a50 (diff)
downloadtrackermap-server-142734931830f117b0e86dfa5f6dddec5416d878.tar.gz
trackermap-server-142734931830f117b0e86dfa5f6dddec5416d878.tar.bz2
trackermap-server-142734931830f117b0e86dfa5f6dddec5416d878.zip
Implement KHD protocol commands
Diffstat (limited to 'src/org/traccar/protocol/KhdProtocol.java')
-rw-r--r--src/org/traccar/protocol/KhdProtocol.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/KhdProtocol.java b/src/org/traccar/protocol/KhdProtocol.java
index be89df580..a2edbfd5e 100644
--- a/src/org/traccar/protocol/KhdProtocol.java
+++ b/src/org/traccar/protocol/KhdProtocol.java
@@ -20,6 +20,7 @@ import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder;
import org.traccar.BaseProtocol;
import org.traccar.TrackerServer;
+import org.traccar.model.Command;
import java.util.List;
@@ -27,6 +28,9 @@ public class KhdProtocol extends BaseProtocol {
public KhdProtocol() {
super("khd");
+ setSupportedCommands(
+ Command.TYPE_ENGINE_STOP,
+ Command.TYPE_ENGINE_RESUME);
}
@Override
@@ -34,8 +38,9 @@ public class KhdProtocol extends BaseProtocol {
serverList.add(new TrackerServer(new ServerBootstrap(), this.getName()) {
@Override
protected void addSpecificHandlers(ChannelPipeline pipeline) {
- pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(256, 3, 2));
+ pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(512, 3, 2));
pipeline.addLast("objectDecoder", new KhdProtocolDecoder(KhdProtocol.this));
+ pipeline.addLast("objectEncoder", new KhdProtocolEncoder());
}
});
}