diff options
author | Christoph Krey <c@ckrey.de> | 2018-04-16 10:45:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-16 10:45:11 +0200 |
commit | 3a602dd133b533cc69d5986d64a00fb3ed670f75 (patch) | |
tree | 97ff753db310a49ae7e53240b1db07fb8475679e /src/org/traccar/protocol/CastelProtocol.java | |
parent | 232de5f0daef98f31b28d177d991fdbfa191f195 (diff) | |
parent | 6d4b8df25c7e942b9ad594db9444fe15bcb16be9 (diff) | |
download | trackermap-server-3a602dd133b533cc69d5986d64a00fb3ed670f75.tar.gz trackermap-server-3a602dd133b533cc69d5986d64a00fb3ed670f75.tar.bz2 trackermap-server-3a602dd133b533cc69d5986d64a00fb3ed670f75.zip |
Merge pull request #4 from traccar/master
upgrade to current master
Diffstat (limited to 'src/org/traccar/protocol/CastelProtocol.java')
-rw-r--r-- | src/org/traccar/protocol/CastelProtocol.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/CastelProtocol.java b/src/org/traccar/protocol/CastelProtocol.java index db9df0674..d5ba5cd55 100644 --- a/src/org/traccar/protocol/CastelProtocol.java +++ b/src/org/traccar/protocol/CastelProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2018 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,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.nio.ByteOrder; import java.util.List; @@ -29,6 +30,9 @@ public class CastelProtocol extends BaseProtocol { public CastelProtocol() { super("castel"); + setSupportedDataCommands( + Command.TYPE_ENGINE_STOP, + Command.TYPE_ENGINE_RESUME); } @Override @@ -37,6 +41,7 @@ public class CastelProtocol extends BaseProtocol { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 2, 2, -4, 0)); + pipeline.addLast("objectEncoder", new CastelProtocolEncoder()); pipeline.addLast("objectDecoder", new CastelProtocolDecoder(CastelProtocol.this)); } }; @@ -46,6 +51,7 @@ public class CastelProtocol extends BaseProtocol { server = new TrackerServer(new ConnectionlessBootstrap(), getName()) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { + pipeline.addLast("objectEncoder", new CastelProtocolEncoder()); pipeline.addLast("objectDecoder", new CastelProtocolDecoder(CastelProtocol.this)); } }; |