aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/PstProtocol.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-07-29 20:58:02 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-07-29 20:58:02 -0700
commit250dc821dd304ca72058012b5a387194489cbe72 (patch)
treeb8aba5cdd8c40442734e8e20b7ab05c03fdad813 /src/main/java/org/traccar/protocol/PstProtocol.java
parent02156420e2b7e8ca60982c60c26245c77069dd6e (diff)
downloadtrackermap-server-250dc821dd304ca72058012b5a387194489cbe72.tar.gz
trackermap-server-250dc821dd304ca72058012b5a387194489cbe72.tar.bz2
trackermap-server-250dc821dd304ca72058012b5a387194489cbe72.zip
Implement PST commands
Diffstat (limited to 'src/main/java/org/traccar/protocol/PstProtocol.java')
-rw-r--r--src/main/java/org/traccar/protocol/PstProtocol.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/PstProtocol.java b/src/main/java/org/traccar/protocol/PstProtocol.java
index 0ed9affd8..d8c7008cb 100644
--- a/src/main/java/org/traccar/protocol/PstProtocol.java
+++ b/src/main/java/org/traccar/protocol/PstProtocol.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019 Anton Tananaev (anton@traccar.org)
+ * Copyright 2019 - 2020 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.
@@ -18,20 +18,27 @@ package org.traccar.protocol;
import org.traccar.BaseProtocol;
import org.traccar.PipelineBuilder;
import org.traccar.TrackerServer;
+import org.traccar.model.Command;
public class PstProtocol extends BaseProtocol {
public PstProtocol() {
+ setSupportedDataCommands(
+ Command.TYPE_ENGINE_STOP,
+ Command.TYPE_ENGINE_RESUME);
addServer(new TrackerServer(true, getName()) {
@Override
protected void addProtocolHandlers(PipelineBuilder pipeline) {
+ pipeline.addLast(new PstProtocolEncoder(PstProtocol.this));
pipeline.addLast(new PstProtocolDecoder(PstProtocol.this));
}
});
addServer(new TrackerServer(false, getName()) {
@Override
protected void addProtocolHandlers(PipelineBuilder pipeline) {
+ pipeline.addLast(new PstFrameEncoder());
pipeline.addLast(new PstFrameDecoder());
+ pipeline.addLast(new PstProtocolEncoder(PstProtocol.this));
pipeline.addLast(new PstProtocolDecoder(PstProtocol.this));
}
});