diff options
author | Hoss Zhou <zhouh@codeaurora.org> | 2021-08-25 10:44:48 +0800 |
---|---|---|
committer | Hoss Zhou <zhouh@codeaurora.org> | 2021-09-06 16:48:41 +0800 |
commit | 67a6cbf4027c0d6e27d6dcf5a49e00845164c9ae (patch) | |
tree | 12daa8523a9b33ad6a0c2f940fff55980c24d0bc | |
parent | 3377673fb267b26d1dc1d93264bcbf61273fed20 (diff) |
nmea:retrieve dop from extended DOP
retrieve dop form extended DOP structure
when GPS_LOCATION_EXTENDED_HAS_EXT_DOP is set.
Change-Id: I8bc90435d1d2de78869b4de09c070b903d1ebe46
CRs-Fixed: 3021456
-rw-r--r-- | utils/loc_nmea.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 8befa4f..0adfb86 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -721,15 +721,17 @@ static uint32_t loc_nmea_generate_GSA(const GpsLocationExtended &locationExtende } // Add the position/horizontal/vertical DOP values - if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) - { + if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) { length = snprintf(pMarker, lengthRemaining, "%.1f,%.1f,%.1f,", locationExtended.pdop, locationExtended.hdop, locationExtended.vdop); - } - else - { // no dop + } else if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_EXT_DOP) { + length = snprintf(pMarker, lengthRemaining, "%.1f,%.1f,%.1f,", + locationExtended.extDOP.PDOP, + locationExtended.extDOP.HDOP, + locationExtended.extDOP.VDOP); + } else { // no dop length = snprintf(pMarker, lengthRemaining, ",,,"); } pMarker += length; @@ -1846,6 +1848,9 @@ void loc_nmea_generate_pos(const UlpLocation &location, if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) { length = snprintf(pMarker, lengthRemaining, "%02d,%.1f,", svUsedCount, locationExtended.hdop); + } else if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_EXT_DOP) { + length = snprintf(pMarker, lengthRemaining, "%02d,%.1f,", + svUsedCount, locationExtended.extDOP.HDOP); } else { // no hdop length = snprintf(pMarker, lengthRemaining, "%02d,,", @@ -2008,6 +2013,9 @@ void loc_nmea_generate_pos(const UlpLocation &location, { length = snprintf(pMarker, lengthRemaining, "%s,%02d,%.1f,", ggaGpsQuality, svUsedCount, locationExtended.hdop); + } else if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_EXT_DOP) { + length = snprintf(pMarker, lengthRemaining, "%s,%02d,%.1f,", + ggaGpsQuality, svUsedCount, locationExtended.extDOP.HDOP); } else { // no hdop |