diff options
author | Wei Chen <weic@codeaurora.org> | 2019-10-03 13:29:47 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-11-04 09:31:27 -0800 |
commit | 7eb1dcf0c743c27dde4814ad6ce22ee50876bbec (patch) | |
tree | 092688991c9587d17237f371335c058e7916e945 | |
parent | 5c568ca1bdd64c4de4a29695457db6bd81d0f5d8 (diff) | |
download | gps-7eb1dcf0c743c27dde4814ad6ce22ee50876bbec.tar.gz |
GPS NMEA: generate empty GSA sentence for dead reckoning fixes
For dead reckoning fixes when number of SV used in fix is 0,
we need to generate an empty GSA sentence
CRs-fixed: 2542163
Change-Id: Icb89981d04ecdfeb81fbdc16b2a8d3676319b18d
-rw-r--r-- | utils/loc_nmea.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 24197ff..64a3525 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -1327,6 +1327,14 @@ void loc_nmea_generate_pos(const UlpLocation &location, talker[1] = sv_meta.talker[1]; } + // if svUsedCount is 0, it means we do not generate any GSA sentence yet. + // in this case, generate an empty GSA sentence + if (svUsedCount == 0) { + strlcpy(sentence, "$GPGSA,A,1,,,,,,,,,,,,,,,,", sizeof(sentence)); + length = loc_nmea_put_checksum(sentence, sizeof(sentence)); + nmeaArraystr.push_back(sentence); + } + char ggaGpsQuality[3] = {'0', '\0', '\0'}; char rmcModeIndicator = 'N'; char vtgModeIndicator = 'N'; |