From 5451efd2f5d343cb6c7e6964055305103b4fbdd2 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 8 Oct 2016 00:58:24 +1300 Subject: Another small Fifotrack decoder fix --- src/org/traccar/protocol/FifotrackProtocolDecoder.java | 2 +- test/org/traccar/protocol/FifotrackProtocolDecoderTest.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/org/traccar/protocol/FifotrackProtocolDecoder.java b/src/org/traccar/protocol/FifotrackProtocolDecoder.java index 9c0f6be5a..a4b7932e6 100644 --- a/src/org/traccar/protocol/FifotrackProtocolDecoder.java +++ b/src/org/traccar/protocol/FifotrackProtocolDecoder.java @@ -37,7 +37,7 @@ public class FifotrackProtocolDecoder extends BaseProtocolDecoder { .text("$$") .number("d+,") // length .number("(d+),") // imei - .number("d+,") // index + .number("x+,") // index .expression("[^,]+,") // type .number("(d+)?,") // alarm .number("(dd)(dd)(dd)") // date diff --git a/test/org/traccar/protocol/FifotrackProtocolDecoderTest.java b/test/org/traccar/protocol/FifotrackProtocolDecoderTest.java index fa45516a2..7cde4b5c9 100644 --- a/test/org/traccar/protocol/FifotrackProtocolDecoderTest.java +++ b/test/org/traccar/protocol/FifotrackProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class FifotrackProtocolDecoderTest extends ProtocolTest { FifotrackProtocolDecoder decoder = new FifotrackProtocolDecoder(new FifotrackProtocol()); + verifyPosition(decoder, text( + "$$105,866104023179743,AB,A00,,161007085534,A,54.738791,25.271918,0,350,151,0,17929,0000,0,,246|1|65|96DB,936|0*0B")); + verifyPosition(decoder, text( "$$103,866104023179743,5,A00,,161006192841,A,54.738791,25.271918,0,342,200,0,4265,0000,0,,246|1|65|96DB,9C4|0*75")); -- cgit v1.2.3