aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar/protocol/MegastekProtocolDecoderTest.java
diff options
context:
space:
mode:
authorOliver Schramm <oliver.schramm97@gmail.com>2021-06-24 19:39:18 +0200
committerOliver Schramm <oliver.schramm97@gmail.com>2021-06-24 19:39:18 +0200
commitc10c4b985002d9b39213f6a4e33466212705f66d (patch)
tree14a9c21c2c5674a8cd0c5d89cfc2e6d1c6614aed /src/test/java/org/traccar/protocol/MegastekProtocolDecoderTest.java
parent48670633fd49e3ec2bd781f858b11ccd2083878d (diff)
downloadtraccar-server-c10c4b985002d9b39213f6a4e33466212705f66d.tar.gz
traccar-server-c10c4b985002d9b39213f6a4e33466212705f66d.tar.bz2
traccar-server-c10c4b985002d9b39213f6a4e33466212705f66d.zip
Improve compatibility with megastek devices
Megastek devices send some data which either is not fully compliant with the megastek protocol (by omitting some data) or which is (for our purposes) garbage data, which is only delimited with a single LF (0x0A).
Diffstat (limited to 'src/test/java/org/traccar/protocol/MegastekProtocolDecoderTest.java')
-rw-r--r--src/test/java/org/traccar/protocol/MegastekProtocolDecoderTest.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/java/org/traccar/protocol/MegastekProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/MegastekProtocolDecoderTest.java
index 3c8377b51..83d62e766 100644
--- a/src/test/java/org/traccar/protocol/MegastekProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/MegastekProtocolDecoderTest.java
@@ -10,6 +10,12 @@ public class MegastekProtocolDecoderTest extends ProtocolTest {
public void testDecode() throws Exception {
var decoder = new MegastekProtocolDecoder(null);
+
+ verifyPosition(decoder, text(
+ "$MGV002,860719020193193,,S,070521,160748,V,2255.09165,N,11404.01322,E,00,00,00,,,,,,,,,,,,,,,,,,,10,015,Restart;!"));
+
+ verifyPosition(decoder, text(
+ "$MGV002,860719020193193,,R,070621,115717,V,2255.09165,N,11404.01322,E,00,00,00,99.9,,,,,460,07,262C,0F54,20,,,,,,,,,10,039,Timer;!"));
verifyPosition(decoder, text(
"0132$MGV002,869152024261561,,S,310818,133945,V,3814.35442,N,02144.50662,E,00,00,00,99.9,,,44.2,,202,10,,,13,0,0,0,0,90,,,,11,100,Timer;!"));