aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/ItsProtocolEncoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-05-11 17:16:21 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-05-11 17:16:21 -0700
commit7ea54b294e59f7a47fea34496de4c053a586a14a (patch)
tree37ceb176fbecf8d37d59b1a60499717976b52732 /src/main/java/org/traccar/protocol/ItsProtocolEncoder.java
parent9256a86c91349f63759c7e7d14eaaf56abd567f3 (diff)
downloadtrackermap-server-7ea54b294e59f7a47fea34496de4c053a586a14a.tar.gz
trackermap-server-7ea54b294e59f7a47fea34496de4c053a586a14a.tar.bz2
trackermap-server-7ea54b294e59f7a47fea34496de4c053a586a14a.zip
Add ITS protocol commands
Diffstat (limited to 'src/main/java/org/traccar/protocol/ItsProtocolEncoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/ItsProtocolEncoder.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/ItsProtocolEncoder.java b/src/main/java/org/traccar/protocol/ItsProtocolEncoder.java
new file mode 100644
index 000000000..ebbbd87cd
--- /dev/null
+++ b/src/main/java/org/traccar/protocol/ItsProtocolEncoder.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2019 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.traccar.protocol;
+
+import org.traccar.StringProtocolEncoder;
+import org.traccar.model.Command;
+
+public class ItsProtocolEncoder extends StringProtocolEncoder {
+
+ @Override
+ protected Object encodeCommand(Command command) {
+
+ switch (command.getType()) {
+ case Command.TYPE_ENGINE_STOP:
+ return "@SET#RLP,OP1,";
+ case Command.TYPE_ENGINE_RESUME:
+ return "@CLR#RLP,OP1,";
+ default:
+ return null;
+ }
+ }
+
+}