aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-11-16 07:11:58 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2017-11-16 07:11:58 +1300
commit37eb70afa59495e7723d215ba5c90e7a871572eb (patch)
tree84e6deaf2bbff133e53a162a63f64cc8e4de9fc9 /src
parent3c77c1287c494208200cfe53d56ffd4bed8ec5ce (diff)
downloadtraccar-server-37eb70afa59495e7723d215ba5c90e7a871572eb.tar.gz
traccar-server-37eb70afa59495e7723d215ba5c90e7a871572eb.tar.bz2
traccar-server-37eb70afa59495e7723d215ba5c90e7a871572eb.zip
Support GP6000F binary protocol
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/Jt600ProtocolDecoder.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/Jt600ProtocolDecoder.java b/src/org/traccar/protocol/Jt600ProtocolDecoder.java
index f76fd8069..58835c7d6 100644
--- a/src/org/traccar/protocol/Jt600ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Jt600ProtocolDecoder.java
@@ -21,6 +21,7 @@ import org.jboss.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
import org.traccar.DeviceSession;
import org.traccar.helper.BcdUtil;
+import org.traccar.helper.BitBuffer;
import org.traccar.helper.BitUtil;
import org.traccar.helper.DateBuilder;
import org.traccar.helper.Parser;
@@ -152,6 +153,19 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder {
fuel += buf.readUnsignedByte();
position.set(Position.KEY_FUEL_LEVEL, fuel);
+ } else if (version == 3) {
+
+ BitBuffer bitBuffer = new BitBuffer(buf);
+
+ position.set("fuel1", bitBuffer.readUnsigned(12));
+ position.set("fuel2", bitBuffer.readUnsigned(12));
+ position.set("fuel3", bitBuffer.readUnsigned(12));
+ position.set(Position.KEY_ODOMETER, bitBuffer.readUnsigned(20) * 1000);
+
+ int status = bitBuffer.readUnsigned(24);
+ position.set(Position.KEY_IGNITION, BitUtil.check(status, 0));
+ position.set(Position.KEY_STATUS, status);
+
}
positions.add(position);