aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/model/Command.java2
-rw-r--r--src/org/traccar/protocol/WondexProtocol.java3
-rw-r--r--src/org/traccar/protocol/WondexProtocolDecoder.java3
-rw-r--r--src/org/traccar/protocol/WondexProtocolEncoder.java8
4 files changed, 14 insertions, 2 deletions
diff --git a/src/org/traccar/model/Command.java b/src/org/traccar/model/Command.java
index 190c0d753..6a48b14e9 100644
--- a/src/org/traccar/model/Command.java
+++ b/src/org/traccar/model/Command.java
@@ -47,6 +47,8 @@ public class Command extends Message {
public static final String TYPE_FIRMWARE_UPDATE = "firmwareUpdate";
public static final String TYPE_SET_CONNECTION = "setConnection";
public static final String TYPE_SET_ODOMETER = "setOdometer";
+ public static final String TYPE_GET_MODEM_STATUS = "getModemStatus";
+ public static final String TYPE_GET_DEVICE_STATUS = "getDeviceStatus";
public static final String TYPE_MODE_POWER_SAVING = "modePowerSaving";
public static final String TYPE_MODE_DEEP_SLEEP = "modeDeepSleep";
diff --git a/src/org/traccar/protocol/WondexProtocol.java b/src/org/traccar/protocol/WondexProtocol.java
index e7e13c63a..ef25265aa 100644
--- a/src/org/traccar/protocol/WondexProtocol.java
+++ b/src/org/traccar/protocol/WondexProtocol.java
@@ -31,8 +31,11 @@ public class WondexProtocol extends BaseProtocol {
super("wondex");
setTextCommandEncoder(new WondexProtocolEncoder());
setSupportedCommands(
+ Command.TYPE_GET_DEVICE_STATUS,
+ Command.TYPE_GET_MODEM_STATUS,
Command.TYPE_REBOOT_DEVICE,
Command.TYPE_POSITION_SINGLE,
+ Command.TYPE_GET_VERSION,
Command.TYPE_IDENTIFICATION);
}
diff --git a/src/org/traccar/protocol/WondexProtocolDecoder.java b/src/org/traccar/protocol/WondexProtocolDecoder.java
index dc334becc..8249d2c68 100644
--- a/src/org/traccar/protocol/WondexProtocolDecoder.java
+++ b/src/org/traccar/protocol/WondexProtocolDecoder.java
@@ -69,7 +69,8 @@ public class WondexProtocolDecoder extends BaseProtocolDecoder {
return null;
} else if (buf.toString(StandardCharsets.US_ASCII).startsWith("$OK:")
- || buf.toString(StandardCharsets.US_ASCII).startsWith("$ERR:")) {
+ || buf.toString(StandardCharsets.US_ASCII).startsWith("$ERR:")
+ || buf.toString(StandardCharsets.US_ASCII).startsWith("$MSG:")) {
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress);
diff --git a/src/org/traccar/protocol/WondexProtocolEncoder.java b/src/org/traccar/protocol/WondexProtocolEncoder.java
index 8f9887b10..6258c1fe6 100644
--- a/src/org/traccar/protocol/WondexProtocolEncoder.java
+++ b/src/org/traccar/protocol/WondexProtocolEncoder.java
@@ -28,9 +28,15 @@ public class WondexProtocolEncoder extends StringProtocolEncoder {
switch (command.getType()) {
case Command.TYPE_REBOOT_DEVICE:
return formatCommand(command, "$WP+REBOOT={%s}", Command.KEY_DEVICE_PASSWORD);
+ case Command.TYPE_GET_DEVICE_STATUS:
+ return formatCommand(command, "$WP+TEST={%s}", Command.KEY_DEVICE_PASSWORD);
+ case Command.TYPE_GET_MODEM_STATUS:
+ return formatCommand(command, "$WP+GSMINFO={%s}", Command.KEY_DEVICE_PASSWORD);
+ case Command.TYPE_IDENTIFICATION:
+ return formatCommand(command, "$WP+IMEI={%s}", Command.KEY_DEVICE_PASSWORD);
case Command.TYPE_POSITION_SINGLE:
return formatCommand(command, "$WP+GETLOCATION={%s}", Command.KEY_DEVICE_PASSWORD);
- case Command.TYPE_IDENTIFICATION:
+ case Command.TYPE_GET_VERSION:
return formatCommand(command, "$WP+VER={%s}", Command.KEY_DEVICE_PASSWORD);
default:
Log.warning(new UnsupportedOperationException(command.getType()));