diff options
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/protocol/UlbotechProtocolDecoder.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/UlbotechProtocolDecoder.java b/src/org/traccar/protocol/UlbotechProtocolDecoder.java index 1de3b50b9..a94da7be7 100644 --- a/src/org/traccar/protocol/UlbotechProtocolDecoder.java +++ b/src/org/traccar/protocol/UlbotechProtocolDecoder.java @@ -20,6 +20,7 @@ import java.util.Date; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; +import org.traccar.Context; import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.UnitsConverter; import org.traccar.model.Event; @@ -27,8 +28,14 @@ import org.traccar.model.Position; public class UlbotechProtocolDecoder extends BaseProtocolDecoder { + private long timeZone; + public UlbotechProtocolDecoder(UlbotechProtocol protocol) { super(protocol); + + if (Context.getConfig().hasKey(protocol + ".timezone")) { + timeZone = Context.getConfig().getInteger(protocol + ".timezone"); + } } private static final short DATA_GPS = 0x01; @@ -68,6 +75,7 @@ public class UlbotechProtocolDecoder extends BaseProtocolDecoder { // Time long seconds = buf.readUnsignedInt() & 0x7fffffffl; seconds += 946684800l; // 2000-01-01 00:00 + seconds -= timeZone; position.setTime(new Date(seconds * 1000)); boolean hasLocation = false; |