From f8665780919e95e8828fb7c771904d1039398e61 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 17 Aug 2013 22:36:13 +1200 Subject: Revert wrong JT600 changes --- src/org/traccar/protocol/Jt600ProtocolDecoder.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/org') diff --git a/src/org/traccar/protocol/Jt600ProtocolDecoder.java b/src/org/traccar/protocol/Jt600ProtocolDecoder.java index e60beb1b2..df6d94e47 100644 --- a/src/org/traccar/protocol/Jt600ProtocolDecoder.java +++ b/src/org/traccar/protocol/Jt600ProtocolDecoder.java @@ -61,12 +61,12 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { // Time Calendar time = Calendar.getInstance(TimeZone.getTimeZone("UTC")); time.clear(); - time.set(Calendar.DAY_OF_MONTH, buf.readUnsignedByte()); - time.set(Calendar.MONTH, buf.readUnsignedByte() - 1); - time.set(Calendar.YEAR, 2000 + buf.readUnsignedByte()); - time.set(Calendar.HOUR, buf.readUnsignedByte()); - time.set(Calendar.MINUTE, buf.readUnsignedByte()); - time.set(Calendar.SECOND, buf.readUnsignedByte()); + time.set(Calendar.DAY_OF_MONTH, ChannelBufferTools.readHexInteger(buf, 2)); + time.set(Calendar.MONTH, ChannelBufferTools.readHexInteger(buf, 2) - 1); + time.set(Calendar.YEAR, 2000 + ChannelBufferTools.readHexInteger(buf, 2)); + time.set(Calendar.HOUR, ChannelBufferTools.readHexInteger(buf, 2)); + time.set(Calendar.MINUTE, ChannelBufferTools.readHexInteger(buf, 2)); + time.set(Calendar.SECOND, ChannelBufferTools.readHexInteger(buf, 2)); position.setTime(time.getTime()); // Coordinates @@ -88,7 +88,7 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { position.setLongitude(longitude); // Speed - position.setSpeed((double) buf.readUnsignedByte()); + position.setSpeed((double) ChannelBufferTools.readHexInteger(buf, 2)); // Course position.setCourse(buf.readUnsignedByte() * 2.0); -- cgit v1.2.3