diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-04-20 15:20:48 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2019-04-20 15:20:48 -0700 |
commit | 2a753836f582912a47e3387d1ed203c8a312da49 (patch) | |
tree | 3fce88c196b4f8eed53b81cb3f8ef4ef3e799e27 /src | |
parent | 570ece9e288d55b4986f59e6d1407666dda94bcb (diff) | |
download | traccar-server-2a753836f582912a47e3387d1ed203c8a312da49.tar.gz traccar-server-2a753836f582912a47e3387d1ed203c8a312da49.tar.bz2 traccar-server-2a753836f582912a47e3387d1ed203c8a312da49.zip |
Fix unit tests
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/traccar/protocol/H02ProtocolDecoder.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java b/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java index 6f1a4f01e..22bbe4441 100644 --- a/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java @@ -88,7 +88,9 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { } private Integer decodeBattery(int value) { - if (value <= 3) { + if (value == 0) { + return null; + } else if (value <= 3) { return (value - 1) * 10; } else if (value <= 6) { return (value - 1) * 20; |