diff options
Diffstat (limited to 'src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.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: |