aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/CityeasyProtocolEncoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/CityeasyProtocolEncoder.java')
-rw-r--r--src/org/traccar/protocol/CityeasyProtocolEncoder.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/CityeasyProtocolEncoder.java b/src/org/traccar/protocol/CityeasyProtocolEncoder.java
index 76c4199e1..9c5695001 100644
--- a/src/org/traccar/protocol/CityeasyProtocolEncoder.java
+++ b/src/org/traccar/protocol/CityeasyProtocolEncoder.java
@@ -19,6 +19,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.traccar.BaseProtocolEncoder;
import org.traccar.helper.Checksum;
+import org.traccar.helper.Log;
import org.traccar.model.Command;
public class CityeasyProtocolEncoder extends BaseProtocolEncoder {
@@ -56,9 +57,16 @@ public class CityeasyProtocolEncoder extends BaseProtocolEncoder {
return encodeContent(CityeasyProtocolDecoder.MSG_LOCATION_INTERVAL, content);
case Command.TYPE_SET_TIMEZONE:
int timezone = ((Number) command.getAttributes().get(Command.KEY_TIMEZONE)).intValue();
- content.writeByte(timezone < 0 ? 1 : 0);
+ if (timezone < 0) {
+ content.writeByte(1);
+ } else {
+ content.writeByte(0);
+ }
content.writeShort(Math.abs(timezone) / 60);
return encodeContent(CityeasyProtocolDecoder.MSG_TIMEZONE, content);
+ default:
+ Log.warning(new UnsupportedOperationException(command.getType()));
+ break;
}
return null;