aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/CastelProtocol.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-03-12 04:56:12 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2018-03-12 04:56:12 +1300
commit4f3cd9dae285cfbd0ff541911381c08f50b59435 (patch)
tree9308e70f977e2c2f04b499de8ac02902b547c948 /src/org/traccar/protocol/CastelProtocol.java
parentd5c79363d91f6ae8594fe2cdde447c7efefaa798 (diff)
downloadtrackermap-server-4f3cd9dae285cfbd0ff541911381c08f50b59435.tar.gz
trackermap-server-4f3cd9dae285cfbd0ff541911381c08f50b59435.tar.bz2
trackermap-server-4f3cd9dae285cfbd0ff541911381c08f50b59435.zip
Implement Castelcom fuel cut commands
Diffstat (limited to 'src/org/traccar/protocol/CastelProtocol.java')
-rw-r--r--src/org/traccar/protocol/CastelProtocol.java8
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));
}
};