diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-06-13 16:23:47 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-06-13 16:23:47 +1200 |
commit | 220a912c1b4f12c4ad0d229e91ed9fd72f4aa327 (patch) | |
tree | 207685f9ca3b27a28fe1e1ce49b89e7df327f10d /src/org/traccar/protocol/Gt06ProtocolDecoder.java | |
parent | 2e1b6a9fc7043b09d511bba5a2acfa02ea0045d4 (diff) | |
download | traccar-server-220a912c1b4f12c4ad0d229e91ed9fd72f4aa327.tar.gz traccar-server-220a912c1b4f12c4ad0d229e91ed9fd72f4aa327.tar.bz2 traccar-server-220a912c1b4f12c4ad0d229e91ed9fd72f4aa327.zip |
Decode Concox AT4 battery voltage
Diffstat (limited to 'src/org/traccar/protocol/Gt06ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/Gt06ProtocolDecoder.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java index fa4ed417d..dfb0b5e07 100644 --- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -431,6 +431,13 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_IGNITION, BitUtil.check(status, 1)); position.set(Position.KEY_CHARGE, BitUtil.check(status, 2)); + if (buf.readableBytes() >= 2 + 6) { + position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.01); + } + if (buf.readableBytes() >= 1 + 6) { + position.set(Position.KEY_RSSI, buf.readUnsignedByte()); + } + sendResponse(channel, false, type, buf.getShort(buf.writerIndex() - 6), null); return position; |