aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-08-17 22:36:13 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2013-08-17 22:36:13 +1200
commitf8665780919e95e8828fb7c771904d1039398e61 (patch)
treee5f962094ab058dcb37d58d2fecfeed9f729ff6b
parentf9210e4709188f7c344fe0dd94fe58b4a89307f8 (diff)
downloadtrackermap-server-f8665780919e95e8828fb7c771904d1039398e61.tar.gz
trackermap-server-f8665780919e95e8828fb7c771904d1039398e61.tar.bz2
trackermap-server-f8665780919e95e8828fb7c771904d1039398e61.zip
Revert wrong JT600 changes
-rw-r--r--src/org/traccar/protocol/Jt600ProtocolDecoder.java14
1 files changed, 7 insertions, 7 deletions
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);