GPS HAL: expose altitude and speed uncertainty

Expose altitude and speed uncertainty from GPS fix via extended
info.

Change-Id: I0a478aa25d4b0a98793c946ba5fb883520a4ce58
This commit is contained in:
Kevin Tang 2013-04-02 11:32:43 -07:00 committed by Gerrit - the friendly Code Review server
parent 9dc77fa9e6
commit 0a760c9f3b
3 changed files with 32 additions and 0 deletions

View file

@ -702,6 +702,18 @@ void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *loca
locationExtended.magneticDeviation = location_report_ptr->magnetic_deviation;
}
if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_VERTICAL_UNC)
{
locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_VERT_UNC;
locationExtended.vert_unc = location_report_ptr->vert_unc;
}
if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_UNC)
{
locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_SPEED_UNC;
locationExtended.speed_unc = location_report_ptr->speed_unc;
}
LOC_LOGV("reportPosition: fire callback\n");
LocApiAdapter::reportPosition(location,
locationExtended,

View file

@ -113,6 +113,10 @@ typedef uint16_t GpsLocationExtendedFlags;
#define GPS_LOCATION_EXTENDED_HAS_MAG_DEV 0x0004
/** UlpLocation has valid mode indicator. */
#define GPS_LOCATION_EXTENDED_HAS_MODE_IND 0x0008
/** GpsLocationExtended has valid vertical uncertainty */
#define GPS_LOCATION_EXTENDED_HAS_VERT_UNC 0x0010
/** GpsLocationExtended has valid speed uncertainty */
#define GPS_LOCATION_EXTENDED_HAS_SPEED_UNC 0x0020
/** Represents gps location extended. */
typedef struct {
@ -130,6 +134,10 @@ typedef struct {
float vdop;
/** Contains Magnetic Deviation. */
float magneticDeviation;
/** vertical uncertainty in meters */
float vert_unc;
/** speed uncertainty in m/s */
float speed_unc;
} GpsLocationExtended;
typedef enum {

View file

@ -1697,6 +1697,18 @@ void LocApiV02Adapter :: reportPosition (
locationExtended.altitudeMeanSeaLevel = location_report_ptr->altitudeWrtMeanSeaLevel;
}
if (location_report_ptr->vertUnc_valid)
{
locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_VERT_UNC;
locationExtended.vert_unc = location_report_ptr->vertUnc;
}
if (location_report_ptr->speedUnc_valid )
{
locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_SPEED_UNC;
locationExtended.speed_unc = location_report_ptr->speedUnc;
}
LocApiAdapter::reportPosition( location,
locationExtended,
locEngHandle.extPosInfo((void*)location_report_ptr),