aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-04-20 15:20:48 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-04-20 15:20:48 -0700
commit2a753836f582912a47e3387d1ed203c8a312da49 (patch)
tree3fce88c196b4f8eed53b81cb3f8ef4ef3e799e27 /src/main/java/org
parent570ece9e288d55b4986f59e6d1407666dda94bcb (diff)
downloadtrackermap-server-2a753836f582912a47e3387d1ed203c8a312da49.tar.gz
trackermap-server-2a753836f582912a47e3387d1ed203c8a312da49.tar.bz2
trackermap-server-2a753836f582912a47e3387d1ed203c8a312da49.zip
Fix unit tests
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/traccar/protocol/H02ProtocolDecoder.java4
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;