aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/CityeasyProtocolEncoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-06 16:12:42 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-06 16:12:42 +1300
commit814794126d232b11a67c06691ed5d5da6c32dd75 (patch)
treed9ef8182894006238ce1fd81bdcebd4ae4c1d6fa /src/org/traccar/protocol/CityeasyProtocolEncoder.java
parente60ecc5f2bc8bb6c53e95c4db2e68cbca79c6e54 (diff)
downloadtrackermap-server-814794126d232b11a67c06691ed5d5da6c32dd75.tar.gz
trackermap-server-814794126d232b11a67c06691ed5d5da6c32dd75.tar.bz2
trackermap-server-814794126d232b11a67c06691ed5d5da6c32dd75.zip
Do not use Java 8 map method
Diffstat (limited to 'src/org/traccar/protocol/CityeasyProtocolEncoder.java')
-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);