aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/protocol/CityeasyProtocolEncoder.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/CityeasyProtocolEncoder.java b/src/org/traccar/protocol/CityeasyProtocolEncoder.java
index 9d15e9d5d..cfe69a462 100644
--- a/src/org/traccar/protocol/CityeasyProtocolEncoder.java
+++ b/src/org/traccar/protocol/CityeasyProtocolEncoder.java
@@ -49,11 +49,13 @@ public class CityeasyProtocolEncoder extends BaseProtocolEncoder {
case Command.TYPE_POSITION_SINGLE:
return encodeContent(CityeasyProtocolDecoder.MSG_LOCATION_REQUEST, content);
case Command.TYPE_POSITION_PERIODIC:
+ content.writeShort(((Number) command.getAttributes().get(Command.KEY_FREQUENCY)).intValue());
+ return encodeContent(CityeasyProtocolDecoder.MSG_LOCATION_INTERVAL, content);
case Command.TYPE_POSITION_STOP:
- content.writeShort(((Number) command.getAttributes().getOrDefault(Command.KEY_FREQUENCY, 0)).intValue());
+ content.writeShort(0);
return encodeContent(CityeasyProtocolDecoder.MSG_LOCATION_INTERVAL, content);
case Command.TYPE_SET_TIMEZONE:
- int timezone = ((Number) command.getAttributes().getOrDefault(Command.KEY_TIMEZONE, 0)).intValue();
+ int timezone = ((Number) command.getAttributes().get(Command.KEY_TIMEZONE)).intValue();
content.writeByte(timezone < 0 ? 1 : 0);
content.writeShort(Math.abs(timezone) / 60);
return encodeContent(CityeasyProtocolDecoder.MSG_TIMEZONE, content);