diff options
author | Anton Tananaev <anton@traccar.org> | 2023-02-25 22:11:51 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-02-25 22:11:51 -0800 |
commit | 9a1cbeb7b754b0147d8ccbc334849fac087d7cda (patch) | |
tree | 3df0f646ec6304e27abfcc262ae3849e4eb4f711 /src/main/java | |
parent | 0f5c17535ff8a3bd7a8c8a0616535077e5c72d39 (diff) | |
download | trackermap-server-9a1cbeb7b754b0147d8ccbc334849fac087d7cda.tar.gz trackermap-server-9a1cbeb7b754b0147d8ccbc334849fac087d7cda.tar.bz2 trackermap-server-9a1cbeb7b754b0147d8ccbc334849fac087d7cda.zip |
Meitrack TA255 battery level
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java index 3acd87b8f..3f1f7f506 100644 --- a/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java @@ -554,8 +554,15 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { buf.skipBytes(length - 2); break; case 0xFEA8: - buf.readUnsignedByte(); // battery status - position.set(Position.KEY_BATTERY_LEVEL, buf.readUnsignedByte()); + if (buf.readUnsignedByte() > 0) { + position.set(Position.KEY_BATTERY_LEVEL, buf.readUnsignedByte()); + } else { + buf.readUnsignedByte(); + } + buf.readUnsignedByte(); // battery 2 status + buf.readUnsignedByte(); // battery 2 level + buf.readUnsignedByte(); // battery 3 status + buf.readUnsignedByte(); // battery 3 level buf.readUnsignedByte(); // battery alert break; default: |