From fae54f18a2f62741abd26c1fa780c59e5802afa2 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Fri, 22 Jul 2016 17:35:40 -0700 Subject: [PATCH] Added debug messages for SV Info Added constellation field in the debug messages for SV Info Change-Id: Ie02b1284cc5c24f526c82c52ff1ecda066655aac CRs-fixed: 1013650 --- core/LocApiBase.cpp | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 40188f93..80b1ae36 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -258,24 +258,35 @@ void LocApiBase::reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { + const char* constellationString[] = { "Unknown", "GPS", "SBAS", "GLONASS", + "QZSS", "BEIDOU", "GALILEO" }; + // print the SV info before delivering - LOC_LOGV("num sv: %d", svStatus.num_svs); + LOC_LOGV("num sv: %d\n" + " sv: constellation svid cN0" + " elevation azimuth flags", + svStatus.num_svs); for (int i = 0; i < svStatus.num_svs && i < GNSS_MAX_SVS; i++) { - LOC_LOGV(" %03d: %02d %d %f %f %f 0x%02X", - i, - svStatus.gnss_sv_list[i].svid, - svStatus.gnss_sv_list[i].constellation, - svStatus.gnss_sv_list[i].c_n0_dbhz, - svStatus.gnss_sv_list[i].elevation, - svStatus.gnss_sv_list[i].azimuth, - svStatus.gnss_sv_list[i].flags); + if (svStatus.gnss_sv_list[i].constellation > + sizeof(constellationString) / sizeof(constellationString[0]) - 1) { + svStatus.gnss_sv_list[i].constellation = 0; + } + LOC_LOGV(" %03d: %*s %02d %f %f %f 0x%02X", + i, + 13, + constellationString[svStatus.gnss_sv_list[i].constellation], + svStatus.gnss_sv_list[i].svid, + svStatus.gnss_sv_list[i].c_n0_dbhz, + svStatus.gnss_sv_list[i].elevation, + svStatus.gnss_sv_list[i].azimuth, + svStatus.gnss_sv_list[i].flags); } // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS( mLocAdapters[i]->reportSv(svStatus, - locationExtended, - svExt) - ); + locationExtended, + svExt) + ); } void LocApiBase::reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet)