From f0bc9d0ac59d23e6c2aa2b05743ab0ded0f13b5e Mon Sep 17 00:00:00 2001 From: Lucas V C Nicolau Date: Mon, 25 Nov 2019 14:15:21 -0300 Subject: Update Xrb28ProtocolDecoder.java accept also 1 --- src/main/java/org/traccar/protocol/Xrb28ProtocolDecoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/traccar/protocol/Xrb28ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Xrb28ProtocolDecoder.java index 938394d6b..31cb77293 100644 --- a/src/main/java/org/traccar/protocol/Xrb28ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Xrb28ProtocolDecoder.java @@ -47,7 +47,7 @@ public class Xrb28ProtocolDecoder extends BaseProtocolDecoder { .expression("..,") // vendor .number("d{15},") // imei .expression("..,") // type - .number("0,") // reserved + .number("[01],") // reserved .number("(dd)(dd)(dd).d+,") // time (hhmmss) .expression("([AV]),") // validity .number("(dd)(dd.d+),") // latitude -- cgit v1.2.3 From 94e41957eb8aa53a6285e2fe3188f589640f0091 Mon Sep 17 00:00:00 2001 From: Lucas V C Nicolau Date: Mon, 25 Nov 2019 14:16:11 -0300 Subject: Update Xrb28ProtocolDecoderTest.java add new regex matching test cases --- src/test/java/org/traccar/protocol/Xrb28ProtocolDecoderTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/traccar/protocol/Xrb28ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Xrb28ProtocolDecoderTest.java index 0f15f31b4..9156182b7 100644 --- a/src/test/java/org/traccar/protocol/Xrb28ProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/Xrb28ProtocolDecoderTest.java @@ -27,6 +27,12 @@ public class Xrb28ProtocolDecoderTest extends ProtocolTest { verifyPosition(decoder, text( "*SCOR,OM,863158022988725,D0,0,124458.00,A,2237.7514,N,11408.6214,E,6,0.21,151216,10,M,A#")); + + verifyPosition(decoder, text( + "*HBCR,OM,123456789123456,D0,1,124458.00,A,2237.7514,N,11408.6214,E,6,0.21,151216,10,M,A#")); + + verifyPosition(decoder, text( + "*SCOR,OM,863158022988725,D0,1,124458.00,A,2237.7514,N,11408.6214,E,6,0.21,151216,10,M,A#")); } -- cgit v1.2.3 From 899f6c69882333c1dd70eb9b862dfa52f67539c7 Mon Sep 17 00:00:00 2001 From: Lucas V C Nicolau Date: Mon, 25 Nov 2019 15:04:17 -0300 Subject: indentation fix --- src/main/java/org/traccar/protocol/Xrb28ProtocolDecoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/traccar/protocol/Xrb28ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Xrb28ProtocolDecoder.java index 31cb77293..69e5b7372 100644 --- a/src/main/java/org/traccar/protocol/Xrb28ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Xrb28ProtocolDecoder.java @@ -47,7 +47,7 @@ public class Xrb28ProtocolDecoder extends BaseProtocolDecoder { .expression("..,") // vendor .number("d{15},") // imei .expression("..,") // type - .number("[01],") // reserved + .number("[01],") // reserved .number("(dd)(dd)(dd).d+,") // time (hhmmss) .expression("([AV]),") // validity .number("(dd)(dd.d+),") // latitude -- cgit v1.2.3 From 89abb77cf63519d60a41f63291ac8277d79f5c2a Mon Sep 17 00:00:00 2001 From: Lucas V C Nicolau Date: Mon, 25 Nov 2019 15:12:42 -0300 Subject: new tests with real data --- .../traccar/protocol/Xrb28ProtocolDecoderTest.java | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/traccar/protocol/Xrb28ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Xrb28ProtocolDecoderTest.java index 9156182b7..c280cc2c7 100644 --- a/src/test/java/org/traccar/protocol/Xrb28ProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/Xrb28ProtocolDecoderTest.java @@ -27,12 +27,24 @@ public class Xrb28ProtocolDecoderTest extends ProtocolTest { verifyPosition(decoder, text( "*SCOR,OM,863158022988725,D0,0,124458.00,A,2237.7514,N,11408.6214,E,6,0.21,151216,10,M,A#")); - - verifyPosition(decoder, text( - "*HBCR,OM,123456789123456,D0,1,124458.00,A,2237.7514,N,11408.6214,E,6,0.21,151216,10,M,A#")); verifyPosition(decoder, text( - "*SCOR,OM,863158022988725,D0,1,124458.00,A,2237.7514,N,11408.6214,E,6,0.21,151216,10,M,A#")); + "*SCOR,NG,868020030346166,D0,1,020047.000,A,2359.35484,S,04615.26737,W,14,0.77,161119,-11.87,M,A#")); + + verifyPosition(decoder, text( + "*SCOR,NG,868020030485741,D0,1,020249.000,A,2359.36260,S,04615.24544,W,13,0.77,201119,13.52,M,A#")); + + verifyPosition(decoder, text( + "*SCOR,NG,868020030491178,D0,1,020533.000,A,2359.34836,S,04615.24559,W,16,0.68,111119,40.97,M,A#")); + + verifyPosition(decoder, text( + "*SCOR,NG,868020030432826,D0,1,020522.000,A,2359.36061,S,04615.24528,W,14,0.76,191119,16.50,M,A#")); + + verifyPosition(decoder, text( + "*SCOR,NG,868020030308430,D0,1,020455.00,A,2359.36129,S,04615.24677,W,12,0.72,201119,8.5,M,A#")); + + verifyPosition(decoder, text( + "*SCOR,NG,868020030485741,D0,1,020519.000,A,2359.36247,S,04615.24459,W,14,0.74,201119,13.56,M,A#")); } -- cgit v1.2.3 From 26020f101b9e0781c5b9a1b5528ea202ab239450 Mon Sep 17 00:00:00 2001 From: Lucas V C Nicolau Date: Mon, 25 Nov 2019 15:14:58 -0300 Subject: only one test --- .../org/traccar/protocol/Xrb28ProtocolDecoderTest.java | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/test/java/org/traccar/protocol/Xrb28ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Xrb28ProtocolDecoderTest.java index c280cc2c7..0512b2d73 100644 --- a/src/test/java/org/traccar/protocol/Xrb28ProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/Xrb28ProtocolDecoderTest.java @@ -29,22 +29,7 @@ public class Xrb28ProtocolDecoderTest extends ProtocolTest { "*SCOR,OM,863158022988725,D0,0,124458.00,A,2237.7514,N,11408.6214,E,6,0.21,151216,10,M,A#")); verifyPosition(decoder, text( - "*SCOR,NG,868020030346166,D0,1,020047.000,A,2359.35484,S,04615.26737,W,14,0.77,161119,-11.87,M,A#")); - - verifyPosition(decoder, text( - "*SCOR,NG,868020030485741,D0,1,020249.000,A,2359.36260,S,04615.24544,W,13,0.77,201119,13.52,M,A#")); - - verifyPosition(decoder, text( - "*SCOR,NG,868020030491178,D0,1,020533.000,A,2359.34836,S,04615.24559,W,16,0.68,111119,40.97,M,A#")); - - verifyPosition(decoder, text( - "*SCOR,NG,868020030432826,D0,1,020522.000,A,2359.36061,S,04615.24528,W,14,0.76,191119,16.50,M,A#")); - - verifyPosition(decoder, text( - "*SCOR,NG,868020030308430,D0,1,020455.00,A,2359.36129,S,04615.24677,W,12,0.72,201119,8.5,M,A#")); - - verifyPosition(decoder, text( - "*SCOR,NG,868020030485741,D0,1,020519.000,A,2359.36247,S,04615.24459,W,14,0.74,201119,13.56,M,A#")); + "*SCOR,NG,868020030346166,D0,1,020047.000,A,2359.35484,S,04615.26737,W,14,0.77,161119,-11.87,M,A#")) } -- cgit v1.2.3 From 3ee1cb4560bc989275061badf9b916c0ed367ae1 Mon Sep 17 00:00:00 2001 From: Lucas V C Nicolau Date: Mon, 25 Nov 2019 15:33:48 -0300 Subject: Update Xrb28ProtocolDecoderTest.java --- src/test/java/org/traccar/protocol/Xrb28ProtocolDecoderTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/traccar/protocol/Xrb28ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Xrb28ProtocolDecoderTest.java index 0512b2d73..20adacd6b 100644 --- a/src/test/java/org/traccar/protocol/Xrb28ProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/Xrb28ProtocolDecoderTest.java @@ -29,7 +29,7 @@ public class Xrb28ProtocolDecoderTest extends ProtocolTest { "*SCOR,OM,863158022988725,D0,0,124458.00,A,2237.7514,N,11408.6214,E,6,0.21,151216,10,M,A#")); verifyPosition(decoder, text( - "*SCOR,NG,868020030346166,D0,1,020047.000,A,2359.35484,S,04615.26737,W,14,0.77,161119,-11.87,M,A#")) + "*SCOR,NG,868020030308430,D0,1,020455.00,A,2359.36129,S,04615.24677,W,12,0.72,201119,8.5,M,A#")); } -- cgit v1.2.3