diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/traccar/StringProtocolEncoder.java | 2 | ||||
-rw-r--r-- | src/main/java/org/traccar/model/Command.java | 1 | ||||
-rw-r--r-- | src/main/java/org/traccar/protocol/WatchProtocolEncoder.java | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/StringProtocolEncoder.java b/src/main/java/org/traccar/StringProtocolEncoder.java index 40dfb25b6..e9fb65500 100644 --- a/src/main/java/org/traccar/StringProtocolEncoder.java +++ b/src/main/java/org/traccar/StringProtocolEncoder.java @@ -39,7 +39,7 @@ public abstract class StringProtocolEncoder extends BaseProtocolEncoder { if (valueFormatter != null) { value = valueFormatter.formatValue(keys[i], object); } - if (value == null) { + if (value == null && object != null) { value = object.toString(); } if (value == null) { 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 8871601a4..f285267ba 100644 --- a/src/main/java/org/traccar/protocol/WatchProtocolEncoder.java +++ b/src/main/java/org/traccar/protocol/WatchProtocolEncoder.java @@ -161,7 +161,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: |