diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-07-23 11:49:28 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-07-23 11:49:28 +1200 |
commit | e176392ddbea44dc94c0904f21338a11b862ad4d (patch) | |
tree | 33b0fe820068470a68741ed51b897fe6db5ee496 | |
parent | 83d2fdc694ca75eaef53adef76dad938e1bd6262 (diff) | |
download | trackermap-server-e176392ddbea44dc94c0904f21338a11b862ad4d.tar.gz trackermap-server-e176392ddbea44dc94c0904f21338a11b862ad4d.tar.bz2 trackermap-server-e176392ddbea44dc94c0904f21338a11b862ad4d.zip |
Improve GpsGate protocol decoder
-rw-r--r-- | src/org/traccar/protocol/GpsGateProtocolDecoder.java | 4 | ||||
-rw-r--r-- | test/org/traccar/protocol/GpsGateProtocolDecoderTest.java | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/GpsGateProtocolDecoder.java b/src/org/traccar/protocol/GpsGateProtocolDecoder.java index 1cb0ddfde..afc17a9f7 100644 --- a/src/org/traccar/protocol/GpsGateProtocolDecoder.java +++ b/src/org/traccar/protocol/GpsGateProtocolDecoder.java @@ -58,10 +58,10 @@ public class GpsGateProtocolDecoder extends BaseProtocolDecoder { .expression("([EW]),") .number("(d+.?d*),") // altitude .number("(d+.?d*),") // speed - .number("(d+.?d*),") // course + .number("(d+.?d*)?,") // course .number("(dd)(dd)(dd),") // date (ddmmyy) .number("(dd)(dd)(dd).?(d+)?,") // time - .expression("([01]),") // validity + .expression("([01])") // validity .any() .compile(); diff --git a/test/org/traccar/protocol/GpsGateProtocolDecoderTest.java b/test/org/traccar/protocol/GpsGateProtocolDecoderTest.java index 30861099f..11cfb66f5 100644 --- a/test/org/traccar/protocol/GpsGateProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GpsGateProtocolDecoderTest.java @@ -11,6 +11,9 @@ public class GpsGateProtocolDecoderTest extends ProtocolTest { GpsGateProtocolDecoder decoder = new GpsGateProtocolDecoder(new GpsGateProtocol()); verifyPosition(decoder, text( + "$FRCMD,356406061385182,_SendMessage,,5223.88542,N,11440.45866,W,951.2,0.027,,220716,153507.00,1*5F")); + + verifyPosition(decoder, text( "$FRCMD,353067011068246,_SendMessage,,1918.1942,N,09906.3696,W,2246.5,000.0,295.9,150416,213147.00,1,Odometer=*70")); verifyNothing(decoder, text( |