diff options
author | Anton Tananaev <anton@traccar.org> | 2023-10-03 07:24:27 +0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-10-03 07:24:27 +0800 |
commit | 45a0d3b8673a5bab98570b84a864e6b313fe2899 (patch) | |
tree | a1be218ab8676057773f9f08902b1b3a628e1d32 /src/main/java/org/traccar | |
parent | 65f54c200cf0dcadaa9a1ce685e3eaeb88ce7506 (diff) | |
download | trackermap-server-45a0d3b8673a5bab98570b84a864e6b313fe2899.tar.gz trackermap-server-45a0d3b8673a5bab98570b84a864e6b313fe2899.tar.bz2 trackermap-server-45a0d3b8673a5bab98570b84a864e6b313fe2899.zip |
Add Seeworld temp and humidity
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r-- | src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java index 161d04d8d..e9bdaf194 100644 --- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -124,6 +124,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { WETRUST, JC400, SL4X, + SEEWORLD, } private Variant variant; @@ -901,6 +902,20 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { } } + if (type == MSG_GPS_LBS_2 && variant == Variant.SEEWORLD) { + position.set(Position.KEY_IGNITION, buf.readUnsignedByte() > 0); + buf.readUnsignedByte(); // reporting mode + buf.readUnsignedByte(); // supplementary transmission + position.set(Position.KEY_ODOMETER, buf.readUnsignedInt()); + buf.readUnsignedInt(); // travel time + int temperature = buf.readUnsignedShort(); + if (BitUtil.check(temperature, 15)) { + temperature = -BitUtil.to(temperature, 15); + } + position.set(Position.PREFIX_TEMP + 1, temperature * 0.01); + position.set("humidity", buf.readUnsignedShort() * 0.01); + } + if ((type == MSG_GPS_LBS_2 || type == MSG_GPS_LBS_3 || type == MSG_GPS_LBS_4) && buf.readableBytes() >= 3 + 6) { position.set(Position.KEY_IGNITION, buf.readUnsignedByte() > 0); @@ -1468,6 +1483,8 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { variant = Variant.JC400; } else if (header == 0x7878 && type == MSG_LBS_3 && length == 0x37) { variant = Variant.SL4X; + } else if (header == 0x7878 && type == MSG_GPS_LBS_2 && length == 0x2f) { + variant = Variant.SEEWORLD; } else { variant = Variant.STANDARD; } |