diff options
author | Anton Tananaev <anton@traccar.org> | 2023-04-29 14:20:38 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-04-29 14:20:38 -0700 |
commit | 0f8dd92a6b1b9a288be888838a30195a6de41250 (patch) | |
tree | 2812b92d9a4f3b5d21e1eece502c6c0f9ca0de59 /src/main/java/org | |
parent | 03cebd3191a9c27c4b38e585b323d5c8d6868571 (diff) | |
download | trackermap-server-0f8dd92a6b1b9a288be888838a30195a6de41250.tar.gz trackermap-server-0f8dd92a6b1b9a288be888838a30195a6de41250.tar.bz2 trackermap-server-0f8dd92a6b1b9a288be888838a30195a6de41250.zip |
Add X3 status sync
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java index 02a629103..7013533bc 100644 --- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -1028,6 +1028,29 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { position.set(Position.PREFIX_ADC + 1, buf.readUnsignedShort() * 0.01); return position; + } else if (subType == 0x04) { + + CharSequence content = buf.readCharSequence(buf.readableBytes() - 4 - 2, StandardCharsets.US_ASCII); + String[] values = content.toString().split(";"); + for (String value : values) { + String[] pair = value.split("="); + switch (pair[0]) { + case "ALM1": + case "ALM2": + case "ALM3": + position.set("alarm" + pair[0].charAt(3) + "Status", Integer.parseInt(pair[1], 16)); + case "STA1": + position.set("otherStatus", Integer.parseInt(pair[1], 16)); + break; + case "DYD": + position.set("engineStatus", Integer.parseInt(pair[1], 16)); + break; + default: + break; + } + } + return position; + } else if (subType == 0x05) { if (buf.readableBytes() >= 6 + 1 + 6) { |