aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrecchia <danilo@deltatecnologia.com>2016-07-12 18:36:42 -0300
committerdrecchia <danilo@deltatecnologia.com>2016-07-12 18:36:42 -0300
commitdb6e8564001a31cf7c4954cc422a1422fcd3c14a (patch)
tree81e798eed1ed34421a4cea9fb57187c1470548d4 /src
parent8d5b4ec5ec8e4aaa2c34793e3100a7782551afbd (diff)
downloadtraccar-server-db6e8564001a31cf7c4954cc422a1422fcd3c14a.tar.gz
traccar-server-db6e8564001a31cf7c4954cc422a1422fcd3c14a.tar.bz2
traccar-server-db6e8564001a31cf7c4954cc422a1422fcd3c14a.zip
- Added support for activate output1, reboot device and request
position.
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/SuntechProtocolEncoder.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/SuntechProtocolEncoder.java b/src/org/traccar/protocol/SuntechProtocolEncoder.java
index d988f97be..2f66d8d0c 100644
--- a/src/org/traccar/protocol/SuntechProtocolEncoder.java
+++ b/src/org/traccar/protocol/SuntechProtocolEncoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com)
+ * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,12 @@ public class SuntechProtocolEncoder extends StringProtocolEncoder {
protected Object encodeCommand(Command command) {
switch (command.getType()) {
+ case Command.TYPE_REBOOT_DEVICE:
+ return formatCommand(command, "SA200CMD;{%s};02;Reboot\r", Command.KEY_UNIQUE_ID);
+ case Command.TYPE_POSITION_SINGLE:
+ return formatCommand(command, "SA200GTR;{%s};02;\r", Command.KEY_UNIQUE_ID);
+ case Command.TYPE_OUTPUT_CONTROL:
+ return formatCommand(command, "SA200CMD;{%s};0{%s};Enable1\r", Command.KEY_UNIQUE_ID, Command.KEY_DATA);
case Command.TYPE_ENGINE_STOP:
return formatCommand(command, "SA200CMD;{%s};02;Enable1\r", Command.KEY_UNIQUE_ID);
case Command.TYPE_ENGINE_RESUME: