diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2022-09-21 09:57:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-21 09:57:52 -0700 |
commit | d5b1385596f79da2514ea7cccf27e9bdeebcacae (patch) | |
tree | f7b2d44f09dee52c09c2c7e2384f0c27f1e65fa1 /src/main/java/org/traccar/protocol/Xexun2Protocol.java | |
parent | 561647947118a86256dbb584f6da450334462739 (diff) | |
parent | 7aa230b9ddcd5540e7ff9c9b3d9bcf5119175c46 (diff) | |
download | trackermap-server-d5b1385596f79da2514ea7cccf27e9bdeebcacae.tar.gz trackermap-server-d5b1385596f79da2514ea7cccf27e9bdeebcacae.tar.bz2 trackermap-server-d5b1385596f79da2514ea7cccf27e9bdeebcacae.zip |
Merge pull request #4912 from stefanclark/Xexun2Encoder
Implement Xexun2 encoder
Diffstat (limited to 'src/main/java/org/traccar/protocol/Xexun2Protocol.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/Xexun2Protocol.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/Xexun2Protocol.java b/src/main/java/org/traccar/protocol/Xexun2Protocol.java index 4630a69e0..52cf731f0 100644 --- a/src/main/java/org/traccar/protocol/Xexun2Protocol.java +++ b/src/main/java/org/traccar/protocol/Xexun2Protocol.java @@ -19,6 +19,7 @@ import org.traccar.BaseProtocol; import org.traccar.PipelineBuilder; import org.traccar.TrackerServer; import org.traccar.config.Config; +import org.traccar.model.Command; import javax.inject.Inject; @@ -26,11 +27,18 @@ public class Xexun2Protocol extends BaseProtocol { @Inject public Xexun2Protocol(Config config) { + setSupportedDataCommands( + Command.TYPE_CUSTOM, + Command.TYPE_POSITION_PERIODIC, + Command.TYPE_POWER_OFF, + Command.TYPE_REBOOT_DEVICE); addServer(new TrackerServer(config, getName(), false) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline, Config config) { + pipeline.addLast(new Xexun2FrameEncoder()); pipeline.addLast(new Xexun2FrameDecoder()); pipeline.addLast(new Xexun2ProtocolDecoder(Xexun2Protocol.this)); + pipeline.addLast(new Xexun2ProtocolEncoder(Xexun2Protocol.this)); } }); } |