From be7f077122deebc468cf609cb5739a845ce7beec Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Mon, 3 Jul 2017 18:46:41 -0700 Subject: [PATCH] Fix to report bearing and speed accuracy 1. Validity bit for vertical uncertainity was conflicting with the validity bit of location source, hence had to change the bit. 2. Modify ZPP API to report speed and bearing accuracy. CRs-Fixed:2064017 Change-Id: I8b09ecab3d67557ad7c2451fee71dbc0e1f14371 --- core/LocApiBase.cpp | 4 +++- core/LocApiBase.h | 3 ++- gnss/GnssAdapter.cpp | 3 ++- utils/loc_gps.h | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 2dcd4cd1..2a0d2050 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -541,10 +541,12 @@ enum loc_api_adapter_err LocApiBase:: } enum loc_api_adapter_err LocApiBase:: - getBestAvailableZppFix(LocGpsLocation & zppLoc, LocPosTechMask & tech_mask) + getBestAvailableZppFix(LocGpsLocation & zppLoc, GpsLocationExtended & locationExtended, + LocPosTechMask & tech_mask) { memset(&zppLoc, 0, sizeof(zppLoc)); memset(&tech_mask, 0, sizeof(tech_mask)); + memset(&locationExtended, 0, sizeof (locationExtended)); DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) } diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 86610e72..aa09be53 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -209,7 +209,8 @@ public: virtual enum loc_api_adapter_err getBestAvailableZppFix(LocGpsLocation & zppLoc); virtual enum loc_api_adapter_err - getBestAvailableZppFix(LocGpsLocation & zppLoc, LocPosTechMask & tech_mask); + getBestAvailableZppFix(LocGpsLocation & zppLoc, GpsLocationExtended & locationExtended, + LocPosTechMask & tech_mask); virtual int initDataServiceClient(bool isDueToSsr); virtual int openAndStartDataCall(); virtual void stopDataCall(); diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 31e992b0..25577ce9 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1616,7 +1616,8 @@ GnssAdapter::getZppCommand() GpsLocationExtended locationExtended = {}; locationExtended.size = sizeof(locationExtended); - mApi.getBestAvailableZppFix(location.gpsLocation, techMask); + mApi.getBestAvailableZppFix(location.gpsLocation, locationExtended, + techMask); //Mark the location source as from ZPP location.gpsLocation.flags |= LOCATION_HAS_SOURCE_INFO; location.position_source = ULP_LOCATION_IS_FROM_ZPP; diff --git a/utils/loc_gps.h b/utils/loc_gps.h index e3f21826..77ebe54a 100644 --- a/utils/loc_gps.h +++ b/utils/loc_gps.h @@ -99,7 +99,7 @@ typedef uint16_t LocGpsLocationFlags; /** LocGpsLocation has valid accuracy. */ #define LOC_GPS_LOCATION_HAS_ACCURACY 0x0010 /** LocGpsLocation has valid vertical uncertainity */ -#define LOC_GPS_LOCATION_HAS_VERT_UNCERTAINITY 0x0020 +#define LOC_GPS_LOCATION_HAS_VERT_UNCERTAINITY 0x0040 /** Flags for the loc_gps_set_capabilities callback. */ @@ -541,7 +541,7 @@ typedef struct { * Represents altitude in meters above the WGS 84 reference ellipsoid. */ double altitude; - /** Represents speed in meters per second. */ + /** Represents horizontal speed in meters per second. */ float speed; /** Represents heading in degrees. */ float bearing;