summaryrefslogtreecommitdiff
path: root/utils/loc_nmea.cpp
diff options
context:
space:
mode:
authorBaili Feng <bailif@codeaurora.org>2017-11-09 17:33:34 +0800
committerBaili Feng <bailif@codeaurora.org>2017-11-09 19:30:14 +0800
commitccd6716531c6b0cc7582d1363c955516d2680bfe (patch)
treecf03573bae933e2560e7cb71e0f4cafc63b85237 /utils/loc_nmea.cpp
parent08cbff337d373d55d09e120e8a77fcfb7378ee3a (diff)
downloadgps-ccd6716531c6b0cc7582d1363c955516d2680bfe.tar.gz
Fix $--RMC sentence
Navigational status should be the last element Change-Id: Ifb201fe95de74e3419e7fe55c55657b41818c64d CRs-fixed: 2140835
Diffstat (limited to 'utils/loc_nmea.cpp')
-rw-r--r--utils/loc_nmea.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp
index 92f3df1..6d34b51 100644
--- a/utils/loc_nmea.cpp
+++ b/utils/loc_nmea.cpp
@@ -641,8 +641,7 @@ void loc_nmea_generate_pos(const UlpLocation &location,
pMarker = sentence;
lengthRemaining = sizeof(sentence);
- // hardcode Navigation Status field to 'V'
- length = snprintf(pMarker, lengthRemaining, "$%sRMC,%02d%02d%02d.%02d,A,V" ,
+ length = snprintf(pMarker, lengthRemaining, "$%sRMC,%02d%02d%02d.%02d,A," ,
talker, utcHours, utcMinutes, utcSeconds,utcMSeconds/10);
if (length < 0 || length >= lengthRemaining)
@@ -790,6 +789,14 @@ void loc_nmea_generate_pos(const UlpLocation &location,
else // A means autonomous
length = snprintf(pMarker, lengthRemaining, "%c", 'A');
+ pMarker += length;
+ lengthRemaining -= length;
+
+ // hardcode Navigation Status field to 'V'
+ length = snprintf(pMarker, lengthRemaining, ",%c", 'V');
+ pMarker += length;
+ lengthRemaining -= length;
+
length = loc_nmea_put_checksum(sentence, sizeof(sentence));
nmeaArraystr.push_back(sentence);
@@ -949,7 +956,7 @@ void loc_nmea_generate_pos(const UlpLocation &location,
length = loc_nmea_put_checksum(sentence, sizeof(sentence));
nmeaArraystr.push_back(sentence);
- strlcpy(sentence, "$GPRMC,,V,,,,,,,,,,N", sizeof(sentence));
+ strlcpy(sentence, "$GPRMC,,V,,,,,,,,,,N,V", sizeof(sentence));
length = loc_nmea_put_checksum(sentence, sizeof(sentence));
nmeaArraystr.push_back(sentence);