From 74f88cf2cc40680869233bcdb97cece139985f96 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 14 Nov 2014 12:30:58 +1300 Subject: Update Haicom decoder --- src/org/traccar/protocol/HaicomProtocolDecoder.java | 8 ++++---- test/org/traccar/protocol/HaicomProtocolDecoderTest.java | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/org/traccar/protocol/HaicomProtocolDecoder.java b/src/org/traccar/protocol/HaicomProtocolDecoder.java index 3531ce0d0..078ee9ae6 100644 --- a/src/org/traccar/protocol/HaicomProtocolDecoder.java +++ b/src/org/traccar/protocol/HaicomProtocolDecoder.java @@ -48,12 +48,12 @@ public class HaicomProtocolDecoder extends BaseProtocolDecoder { "(\\d+)," + // Speed "(\\d+)," + // Course "(\\d+)," + // Status - "(\\d*)," + // GPRS counting value - "(\\d*)," + // GPS power saving counting value + "(\\d+)?," + // GPRS counting value + "(\\d+)?," + // GPS power saving counting value "(\\d+)," + // Switch status "(\\d+)" + // Relay status - "[LH]{0,2}" + // Power status - "\\#V(\\d+)"); // Battery + "(?:[LH]{2})?" + // Power status + "\\#V(\\d+).*"); // Battery @Override protected Object decode( diff --git a/test/org/traccar/protocol/HaicomProtocolDecoderTest.java b/test/org/traccar/protocol/HaicomProtocolDecoderTest.java index 342d6204b..47468ffda 100644 --- a/test/org/traccar/protocol/HaicomProtocolDecoderTest.java +++ b/test/org/traccar/protocol/HaicomProtocolDecoderTest.java @@ -13,6 +13,9 @@ public class HaicomProtocolDecoderTest { verify(decoder.decode(null, null, "$GPRS123456789012345,602S19A,100915,063515,7240649312041079,0019,3156,111000,10004,0000,11111,00LH#V037")); + + verify(decoder.decode(null, null, + "$GPRS123456789012345,T100001,141112,090751,7240649312041079,0002,1530,000001,,,1,00#V039*")); } -- cgit v1.2.3