aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorGavriel Fleischer <flocsy@gmail.com>2019-11-09 23:51:41 +0200
committerGavriel Fleischer <flocsy@gmail.com>2019-11-09 23:51:41 +0200
commit47a1af1554b0216eae8248227407486c0eba8ef3 (patch)
tree65478eb23a6ae1bc08248040498117802e20ff72 /src/main/java/org/traccar
parentfd6d1aa06ba983e17833b11393cfb344e5825fba (diff)
downloadtrackermap-server-47a1af1554b0216eae8248227407486c0eba8ef3.tar.gz
trackermap-server-47a1af1554b0216eae8248227407486c0eba8ef3.tar.bz2
trackermap-server-47a1af1554b0216eae8248227407486c0eba8ef3.zip
added language to watch protocol's set_timezone command
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/model/Command.java1
-rw-r--r--src/main/java/org/traccar/protocol/WatchProtocolEncoder.java4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/model/Command.java b/src/main/java/org/traccar/model/Command.java
index 336fc61f4..abe538a10 100644
--- a/src/main/java/org/traccar/model/Command.java
+++ b/src/main/java/org/traccar/model/Command.java
@@ -68,6 +68,7 @@ public class Command extends Message implements Cloneable {
public static final String KEY_UNIQUE_ID = "uniqueId";
public static final String KEY_FREQUENCY = "frequency";
+ public static final String KEY_LANGUAGE = "language";
public static final String KEY_TIMEZONE = "timezone";
public static final String KEY_DEVICE_PASSWORD = "devicePassword";
public static final String KEY_RADIUS = "radius";
diff --git a/src/main/java/org/traccar/protocol/WatchProtocolEncoder.java b/src/main/java/org/traccar/protocol/WatchProtocolEncoder.java
index b433dfd2a..1c535e9de 100644
--- a/src/main/java/org/traccar/protocol/WatchProtocolEncoder.java
+++ b/src/main/java/org/traccar/protocol/WatchProtocolEncoder.java
@@ -47,6 +47,8 @@ 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;
@@ -161,7 +163,7 @@ public class WatchProtocolEncoder extends StringProtocolEncoder implements Strin
case Command.TYPE_POSITION_PERIODIC:
return formatTextCommand(channel, command, "UPLOAD,{%s}", Command.KEY_FREQUENCY);
case Command.TYPE_SET_TIMEZONE:
- return formatTextCommand(channel, command, "LZ,,{%s}", 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);
default: