aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-02-28 05:43:44 -0800
committerAnton Tananaev <anton@traccar.org>2024-02-28 05:43:44 -0800
commit35829121adea923d0184e88d38939713bd5f9d4a (patch)
tree0e1c29ab67cb1f5c8b976118f0e71a42570a0ba4 /src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
parent967d32485fc685774a9cbeba5b42273b0695bcf7 (diff)
downloadtrackermap-server-35829121adea923d0184e88d38939713bd5f9d4a.tar.gz
trackermap-server-35829121adea923d0184e88d38939713bd5f9d4a.tar.bz2
trackermap-server-35829121adea923d0184e88d38939713bd5f9d4a.zip
Initial G1C Pro support
Diffstat (limited to 'src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
index 2243bd982..7a6c305e1 100644
--- a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
@@ -948,6 +948,7 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder {
int type = buf.readUnsignedByte();
if (type == 0xF0) {
+
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
@@ -1115,6 +1116,24 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder {
}
return position;
+
+ } else if (type == 0xFF) {
+
+ Position position = new Position(getProtocolName());
+ position.setDeviceId(deviceSession.getDeviceId());
+
+ position.setValid(true);
+ position.setTime(readDate(buf, deviceSession.get(DeviceSession.KEY_TIMEZONE)));
+ position.setLatitude(buf.readInt() * 0.000001);
+ position.setLongitude(buf.readInt() * 0.000001);
+ position.setAltitude(buf.readShort());
+ position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedShort() * 0.1));
+ position.setCourse(buf.readUnsignedShort());
+
+ // TODO more positions and g sensor data
+
+ return position;
+
}
return null;