[bugfix][T108][bug-view-1472]The parameter flags of the GNSS callback in the Gaoxin version of [GNSS] is not printed in the callback
Only Configure: No
Affected branch: GSW_V1453
Affected module: GNSS
Is it affected on IC: only ASR
Self-test: yes
Doc Update: no
Change-Id: I1c8919ce02bf5fbc0cbf324e9cbc95c4592d7624
diff --git a/mbtk/libgsw_lib/gsw_gnss_interface.c b/mbtk/libgsw_lib/gsw_gnss_interface.c
index be46146..99496e9 100755
--- a/mbtk/libgsw_lib/gsw_gnss_interface.c
+++ b/mbtk/libgsw_lib/gsw_gnss_interface.c
@@ -361,7 +361,7 @@
return;
}
- if(ind_type == MBTK_GNSS_IND_LOCATION) {
+ if(ind_type == MBTK_GNSS_IND_LOCATION && gsw_cb->gsw_location_cb != NULL) {
if(data_len != sizeof(mbtk_gnss_location_info_t))
{
LOGE("[GSW_gnss] data size error");
@@ -376,9 +376,10 @@
gsw_location_t.speed = locl_info->speed;
gsw_location_t.bearing = locl_info->bearing;
gsw_location_t.timestamp = locl_info->timestamp;
+ gsw_location_t.flags = locl_info->flags;
gsw_location.legacyLocation = gsw_location_t;
gsw_cb->gsw_location_cb(&gsw_location);
- } else if(ind_type == MBTK_GNSS_IND_NMEA) {
+ } else if(ind_type == MBTK_GNSS_IND_NMEA && gsw_cb->gsw_nmea_cb != NULL) {
mopen_gnss_nmea_info_t qser_nmea = {0};
memset(&qser_nmea, 0x0, sizeof(mopen_gnss_nmea_info_t));
qser_nmea.length = data_len;
@@ -406,7 +407,7 @@
if(ret == 0)
{
mbtk_gnss_ind_set=(int(*)(uint32_t ,int))dlsym(dlHandle_gnss, "mbtk_gnss_ind_set");
- ret = mbtk_gnss_ind_set(MBTK_GNSS_IND_NMEA, QSER_GNSS_TIMEOUT);
+ ret = mbtk_gnss_ind_set(MBTK_GNSS_IND_NMEA |MBTK_GNSS_IND_LOCATION, QSER_GNSS_TIMEOUT);
if(ret == 0)
{
inited = true;
diff --git a/mbtk/test/libgsw_lib/gsw_gnss_test.c b/mbtk/test/libgsw_lib/gsw_gnss_test.c
index 1930846..7878407 100755
--- a/mbtk/test/libgsw_lib/gsw_gnss_test.c
+++ b/mbtk/test/libgsw_lib/gsw_gnss_test.c
@@ -117,8 +117,27 @@
printf("%s",nmea);
}
+void tmp_location_gnss_callack(GSW_GNSS_LOCATION_EXT_T* location)
+{
+ printf("Location Info:\n");
+ printf(" Size: %zu\n", location->legacyLocation.size);
+ printf(" Flags: %hu\n", location->legacyLocation.flags);
+ printf(" Latitude: %.6lf°\n", location->legacyLocation.latitude);
+ printf(" Longitude: %.6lf°\n", location->legacyLocation.longitude);
+ printf(" Altitude: %.2lf m\n", location->legacyLocation.altitude);
+ printf(" Speed: %.2f m/s\n", location->legacyLocation.speed);
+ printf(" Bearing: %.1f°\n", location->legacyLocation.bearing);
+ printf(" Accuracy: %.2f m\n", location->legacyLocation.accuracy);
+ printf(" Timestamp: %lld\n", location->legacyLocation.timestamp);
+ printf("Extended Accuracy:\n");
+ printf(" Horizontal: %.2f m (68%%)\n", location->horizontalAccuracyMeters);
+ printf(" Vertical: %.2f m (68%%)\n", location->verticalAccuracyMeters);
+ printf(" Speed: %.2f m/s (68%%)\n", location->speedAccuracyMetersPerSecond);
+ printf(" Bearing: %.1f° (68%%)\n", location->bearingAccuracyDegrees);
+}
+
gsw_gnss_cb tmp_ptr = {
- NULL,
+ tmp_location_gnss_callack,
tmp_gnss_callack
};