From 2a753836f582912a47e3387d1ed203c8a312da49 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 20 Apr 2019 15:20:48 -0700 Subject: Fix unit tests --- src/main/java/org/traccar/protocol/H02ProtocolDecoder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main') 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; -- cgit v1.2.3