diff options
author | Anton Tananaev <anton@traccar.org> | 2024-07-20 17:37:32 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2024-07-20 17:37:32 -0700 |
commit | e1be8916132fd0102cfe298a75abcfdcd43f244b (patch) | |
tree | e8a8e76ddfbaa62a8eb8ecf4dc958bf8e3be8929 /src/main/java/org | |
parent | 50e9eced4a045c6d1e71abc5203b73da9673abc0 (diff) | |
download | trackermap-server-e1be8916132fd0102cfe298a75abcfdcd43f244b.tar.gz trackermap-server-e1be8916132fd0102cfe298a75abcfdcd43f244b.tar.bz2 trackermap-server-e1be8916132fd0102cfe298a75abcfdcd43f244b.zip |
Support Jimi IoT extended heartbeat
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java index f17671cd7..e25499190 100644 --- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -88,6 +88,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { public static final int MSG_X1_GPS = 0x34; public static final int MSG_X1_PHOTO_INFO = 0x35; public static final int MSG_X1_PHOTO_DATA = 0x36; + public static final int MSG_STATUS_2 = 0x36; // Jimi IoT 4G public static final int MSG_WIFI_2 = 0x69; public static final int MSG_GPS_MODULAR = 0x70; public static final int MSG_WIFI_4 = 0xF3; @@ -218,6 +219,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { private static boolean hasStatus(int type) { switch (type) { case MSG_STATUS: + case MSG_STATUS_2: case MSG_LBS_STATUS: case MSG_GPS_LBS_STATUS_1: case MSG_GPS_LBS_STATUS_2: @@ -845,6 +847,20 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { } } + if (type == MSG_STATUS_2) { + buf.readUnsignedByte(); // language + while (buf.readableBytes() > 6) { + int moduleType = buf.readUnsignedShort(); + int moduleLength = buf.readUnsignedByte(); + switch (moduleType) { + case 0x0018 -> position.set(Position.KEY_BATTERY, buf.readUnsignedShort() / 100.0); + case 0x0032 -> position.set("startupStatus", buf.readUnsignedByte()); + case 0x006A -> position.set(Position.KEY_BATTERY_LEVEL, buf.readUnsignedByte()); + default -> buf.skipBytes(moduleLength); + } + } + } + if (type == MSG_GPS_LBS_STATUS_5) { buf.readUnsignedByte(); // language position.set(Position.KEY_ODOMETER, buf.readUnsignedInt()); |