aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/TeltonikaProtocol.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-07-11 16:47:11 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-07-11 16:47:11 +1200
commit2cc6f2e4b4610ddc5aafd8b043ff86a86d57cc29 (patch)
tree5be5960b967f50a14f4aef9783124c08a2cf52f3 /src/org/traccar/protocol/TeltonikaProtocol.java
parent4421f18d004bc51c67007c1a3bab8c3e03930acc (diff)
downloadtrackermap-server-2cc6f2e4b4610ddc5aafd8b043ff86a86d57cc29.tar.gz
trackermap-server-2cc6f2e4b4610ddc5aafd8b043ff86a86d57cc29.tar.bz2
trackermap-server-2cc6f2e4b4610ddc5aafd8b043ff86a86d57cc29.zip
Implement Teltonika commands (fix #1948)
Diffstat (limited to 'src/org/traccar/protocol/TeltonikaProtocol.java')
-rw-r--r--src/org/traccar/protocol/TeltonikaProtocol.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/TeltonikaProtocol.java b/src/org/traccar/protocol/TeltonikaProtocol.java
index f944c3003..5a550d4c0 100644
--- a/src/org/traccar/protocol/TeltonikaProtocol.java
+++ b/src/org/traccar/protocol/TeltonikaProtocol.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 TeltonikaProtocol extends BaseProtocol {
public TeltonikaProtocol() {
super("teltonika");
+ setSupportedCommands(
+ Command.TYPE_CUSTOM);
}
@Override
@@ -35,12 +38,14 @@ public class TeltonikaProtocol extends BaseProtocol {
@Override
protected void addSpecificHandlers(ChannelPipeline pipeline) {
pipeline.addLast("frameDecoder", new TeltonikaFrameDecoder());
+ pipeline.addLast("objectEncoder", new TeltonikaProtocolEncoder());
pipeline.addLast("objectDecoder", new TeltonikaProtocolDecoder(TeltonikaProtocol.this));
}
});
serverList.add(new TrackerServer(new ConnectionlessBootstrap(), this.getName()) {
@Override
protected void addSpecificHandlers(ChannelPipeline pipeline) {
+ pipeline.addLast("objectEncoder", new TeltonikaProtocolEncoder());
pipeline.addLast("objectDecoder", new TeltonikaProtocolDecoder(TeltonikaProtocol.this));
}
});