aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-01-15 21:05:56 -0800
committerGitHub <noreply@github.com>2020-01-15 21:05:56 -0800
commita5a4a31a8826998ff479294ea3885dd4a124f3e8 (patch)
tree68b58ad1c224a6de73446f12c3fc0620a89e0527
parent10ce85ef9eed15276534938c7a18c04cb18ca7f2 (diff)
parent8f6205556add7ac258a740c644ecdb0496f91869 (diff)
downloadtrackermap-server-a5a4a31a8826998ff479294ea3885dd4a124f3e8.tar.gz
trackermap-server-a5a4a31a8826998ff479294ea3885dd4a124f3e8.tar.bz2
trackermap-server-a5a4a31a8826998ff479294ea3885dd4a124f3e8.zip
Merge pull request #4429 from IanCassTwo/nbr-negative
Allow negative number in cell data (signal strength?)
-rw-r--r--src/main/java/org/traccar/protocol/H02ProtocolDecoder.java2
-rw-r--r--src/test/java/org/traccar/protocol/H02ProtocolDecoderTest.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java b/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java
index 529643f6c..320fe991d 100644
--- a/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java
@@ -224,7 +224,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder {
.number("(d+),") // mnc
.number("d+,") // gsm delay time
.number("d+,") // count
- .number("((?:d+,d+,d+,)+)") // cells
+ .number("((?:d+,d+,-?d+,)+)") // cells
.number("(dd)(dd)(dd),") // date (ddmmyy)
.number("(x{8})") // status
.any()
diff --git a/src/test/java/org/traccar/protocol/H02ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/H02ProtocolDecoderTest.java
index 306555736..fe4988b5a 100644
--- a/src/test/java/org/traccar/protocol/H02ProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/H02ProtocolDecoderTest.java
@@ -109,6 +109,9 @@ public class H02ProtocolDecoderTest extends ProtocolTest {
verifyAttributes(decoder, buffer(
"*HQ,4208150188,NBR,210249,260,6,0,7,1014,50675,37,1014,50633,27,1014,17933,18,1014,17231,15,1014,50632,12,1014,13211,11,1014,17031,10,281216,FFFFFBFF,2#"));
+
+ verifyAttributes(decoder, buffer(
+ "*HQ,7401004662,NBR,160453,234,10,0,2,21580,27766,-67,21580,27766,-67,291019,FFFFFBFF,6#"));
verifyAttributes(decoder, buffer(
"*HQ,1600068812,NBR,141335,262,02,255,6,431,17003,26,431,11101,13,431,6353,13,431,22172,13,431,11093,13,431,60861,10,151216,FFFFFBFF#"));