From b6b565858154dd8293829ee7f4d982178d97a0a3 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 24 Feb 2016 16:59:45 +1300 Subject: Save OBD cleared distance value --- src/org/traccar/helper/ObdDecoder.java | 2 +- test/org/traccar/protocol/UlbotechProtocolDecoderTest.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/org/traccar/helper/ObdDecoder.java b/src/org/traccar/helper/ObdDecoder.java index 35fa4dc07..f52216cae 100644 --- a/src/org/traccar/helper/ObdDecoder.java +++ b/src/org/traccar/helper/ObdDecoder.java @@ -69,7 +69,7 @@ public final class ObdDecoder { case PID_FUEL_LEVEL: return createEntry(Event.KEY_FUEL, intValue * 100 / 255); case PID_DISTANCE_CLEARED: - return createEntry(Event.KEY_FUEL, intValue); + return createEntry("cleared-distance", intValue); default: return null; } diff --git a/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java b/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java index e87e95efe..edee9930d 100644 --- a/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java +++ b/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class UlbotechProtocolDecoderTest extends ProtocolTest { UlbotechProtocolDecoder decoder = new UlbotechProtocolDecoder(new UlbotechProtocol()); + verifyPosition(decoder, binary( + "f8010103515790566431569e5fbb9d010e015ee2b906bde4a000000000009f03040a4000000404000115fe05060340173f22030711310583410c0000310d00312f834131000008040000b78c09077320290082c021100101120af8")); + verifyNothing(decoder, binary( "2a545330312c33353430343330353133383934363023")); -- cgit v1.2.3