diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-08-30 21:22:25 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-08-30 21:22:25 +1200 |
commit | b372786bc73aa3f3f89b3a321585bd95c81d0031 (patch) | |
tree | 173177fc46e5433c9cb3daec59d8eb75fbdf42ba | |
parent | 8a866049c73636f6f25ff59550da8c5445e7c8fc (diff) | |
download | trackermap-server-b372786bc73aa3f3f89b3a321585bd95c81d0031.tar.gz trackermap-server-b372786bc73aa3f3f89b3a321585bd95c81d0031.tar.bz2 trackermap-server-b372786bc73aa3f3f89b3a321585bd95c81d0031.zip |
More Megastek decoder improvements
-rw-r--r-- | src/org/traccar/protocol/MegastekProtocolDecoder.java | 6 | ||||
-rw-r--r-- | test/org/traccar/protocol/MegastekProtocolDecoderTest.java | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/MegastekProtocolDecoder.java b/src/org/traccar/protocol/MegastekProtocolDecoder.java index 81349ce3e..a330947b1 100644 --- a/src/org/traccar/protocol/MegastekProtocolDecoder.java +++ b/src/org/traccar/protocol/MegastekProtocolDecoder.java @@ -241,9 +241,9 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder { .number("(dd),") // satellites .number("dd,") .number("(d+.d+),") // hdop - .number("(d+.d+),") // speed - .number("(d+.d+),") // course - .number("(d+.d+),") // altitude + .number("(d+.d+)?,") // speed + .number("(d+.d+)?,") // course + .number("(-?d+.d+),") // altitude .number("(d+.d+)?,") // odometer .number("(d+),") // mcc .number("(d+),") // mnc diff --git a/test/org/traccar/protocol/MegastekProtocolDecoderTest.java b/test/org/traccar/protocol/MegastekProtocolDecoderTest.java index d6056869b..fae0ef93d 100644 --- a/test/org/traccar/protocol/MegastekProtocolDecoderTest.java +++ b/test/org/traccar/protocol/MegastekProtocolDecoderTest.java @@ -11,6 +11,9 @@ public class MegastekProtocolDecoderTest extends ProtocolTest { MegastekProtocolDecoder decoder = new MegastekProtocolDecoder(new MegastekProtocol()); verifyPosition(decoder, text( + "$MGV002,869152024446923,,S,290816,200627,V,5056.21059,N,00439.25034,E,00,00,00,99.9,,,-25.1,,206,01,0BBB,4418,28,,,,,,,,,01,093,Timer;")); + + verifyPosition(decoder, text( "$MGV002,869152024446923,869152024446923,S,240816,151631,A,5053.83335,N,00424.05702,E,00,10,00,0.88,2.645,76.09,22.7,,206,01,07D1,6600,28,,,,,,,,,01,100,Timer;!")); verifyPosition(decoder, text( |