aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/WatchProtocolEncoder.java
diff options
context:
space:
mode:
authorGavriel Fleischer <flocsy@gmail.com>2019-11-11 00:20:13 +0200
committerGavriel Fleischer <flocsy@gmail.com>2019-11-11 00:20:13 +0200
commit8a696af4d92821ccf741c21dcbe118861008743a (patch)
tree74cd5697a87603c4b17ca84206cea9fc34d91f9f /src/main/java/org/traccar/protocol/WatchProtocolEncoder.java
parent47a1af1554b0216eae8248227407486c0eba8ef3 (diff)
parent81a7195b2efe148d47e3cf0cead0de415529bbab (diff)
downloadtraccar-server-8a696af4d92821ccf741c21dcbe118861008743a.tar.gz
traccar-server-8a696af4d92821ccf741c21dcbe118861008743a.tar.bz2
traccar-server-8a696af4d92821ccf741c21dcbe118861008743a.zip
Merge branch 'master' into set-language
# Conflicts: # src/main/java/org/traccar/StringProtocolEncoder.java # src/main/java/org/traccar/protocol/WatchProtocolEncoder.java
Diffstat (limited to 'src/main/java/org/traccar/protocol/WatchProtocolEncoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/WatchProtocolEncoder.java24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/main/java/org/traccar/protocol/WatchProtocolEncoder.java b/src/main/java/org/traccar/protocol/WatchProtocolEncoder.java
index 1c535e9de..f285267ba 100644
--- a/src/main/java/org/traccar/protocol/WatchProtocolEncoder.java
+++ b/src/main/java/org/traccar/protocol/WatchProtocolEncoder.java
@@ -47,8 +47,6 @@ public class WatchProtocolEncoder extends StringProtocolEncoder implements Strin
return DataConverter.printHex(value.toString().getBytes(StandardCharsets.UTF_16BE));
} else if (key.equals(Command.KEY_ENABLE)) {
return (boolean) value ? "1" : "0";
- } else if (key.equals(Command.KEY_LANGUAGE)) {
- return String.valueOf(value);
}
return null;
@@ -139,33 +137,33 @@ public class WatchProtocolEncoder extends StringProtocolEncoder implements Strin
case Command.TYPE_POSITION_SINGLE:
return formatTextCommand(channel, command, "RG");
case Command.TYPE_SOS_NUMBER:
- return formatTextCommand(channel, command, "SOS{%s},{%s}", Command.KEY_INDEX, Command.KEY_PHONE);
+ return formatTextCommand(channel, command, "SOS%s,%s", Command.KEY_INDEX, Command.KEY_PHONE);
case Command.TYPE_ALARM_SOS:
- return formatTextCommand(channel, command, "SOSSMS,{%s}", Command.KEY_ENABLE);
+ return formatTextCommand(channel, command, "SOSSMS,%s", Command.KEY_ENABLE);
case Command.TYPE_ALARM_BATTERY:
- return formatTextCommand(channel, command, "LOWBAT,{%s}", Command.KEY_ENABLE);
+ return formatTextCommand(channel, command, "LOWBAT,%s", Command.KEY_ENABLE);
case Command.TYPE_REBOOT_DEVICE:
return formatTextCommand(channel, command, "RESET");
case Command.TYPE_POWER_OFF:
return formatTextCommand(channel, command, "POWEROFF");
case Command.TYPE_ALARM_REMOVE:
- return formatTextCommand(channel, command, "REMOVE,{%s}", Command.KEY_ENABLE);
+ return formatTextCommand(channel, command, "REMOVE,%s", Command.KEY_ENABLE);
case Command.TYPE_SILENCE_TIME:
- return formatTextCommand(channel, command, "SILENCETIME,{%s}", Command.KEY_DATA);
+ return formatTextCommand(channel, command, "SILENCETIME,%s", Command.KEY_DATA);
case Command.TYPE_ALARM_CLOCK:
- return formatTextCommand(channel, command, "REMIND,{%s}", Command.KEY_DATA);
+ return formatTextCommand(channel, command, "REMIND,%s", Command.KEY_DATA);
case Command.TYPE_SET_PHONEBOOK:
- return formatTextCommand(channel, command, "PHB,{%s}", Command.KEY_DATA);
+ return formatTextCommand(channel, command, "PHB,%s", Command.KEY_DATA);
case Command.TYPE_MESSAGE:
- return formatTextCommand(channel, command, "MESSAGE,{%s}", Command.KEY_MESSAGE);
+ return formatTextCommand(channel, command, "MESSAGE,%s", Command.KEY_MESSAGE);
case Command.TYPE_VOICE_MESSAGE:
return formatBinaryCommand(channel, command, "TK,", getBinaryData(command));
case Command.TYPE_POSITION_PERIODIC:
- return formatTextCommand(channel, command, "UPLOAD,{%s}", Command.KEY_FREQUENCY);
+ return formatTextCommand(channel, command, "UPLOAD,%s", Command.KEY_FREQUENCY);
case Command.TYPE_SET_TIMEZONE:
- return formatTextCommand(channel, command, "LZ,{%s},{%s}", Command.KEY_LANGUAGE, Command.KEY_TIMEZONE);
+ return formatTextCommand(channel, command, "LZ,%s,%s", Command.KEY_LANGUAGE, Command.KEY_TIMEZONE);
case Command.TYPE_SET_INDICATOR:
- return formatTextCommand(channel, command, "FLOWER,{%s}", Command.KEY_DATA);
+ return formatTextCommand(channel, command, "FLOWER,%s", Command.KEY_DATA);
default:
return null;
}