Merge "GPS HAL: expose altitude and speed uncertainty"
This commit is contained in:
commit
d58a6ac3a2
3 changed files with 32 additions and 0 deletions
|
@ -702,6 +702,18 @@ void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *loca
|
||||||
locationExtended.magneticDeviation = location_report_ptr->magnetic_deviation;
|
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");
|
LOC_LOGV("reportPosition: fire callback\n");
|
||||||
LocApiAdapter::reportPosition(location,
|
LocApiAdapter::reportPosition(location,
|
||||||
locationExtended,
|
locationExtended,
|
||||||
|
|
|
@ -113,6 +113,10 @@ typedef uint16_t GpsLocationExtendedFlags;
|
||||||
#define GPS_LOCATION_EXTENDED_HAS_MAG_DEV 0x0004
|
#define GPS_LOCATION_EXTENDED_HAS_MAG_DEV 0x0004
|
||||||
/** UlpLocation has valid mode indicator. */
|
/** UlpLocation has valid mode indicator. */
|
||||||
#define GPS_LOCATION_EXTENDED_HAS_MODE_IND 0x0008
|
#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. */
|
/** Represents gps location extended. */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -130,6 +134,10 @@ typedef struct {
|
||||||
float vdop;
|
float vdop;
|
||||||
/** Contains Magnetic Deviation. */
|
/** Contains Magnetic Deviation. */
|
||||||
float magneticDeviation;
|
float magneticDeviation;
|
||||||
|
/** vertical uncertainty in meters */
|
||||||
|
float vert_unc;
|
||||||
|
/** speed uncertainty in m/s */
|
||||||
|
float speed_unc;
|
||||||
} GpsLocationExtended;
|
} GpsLocationExtended;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|
|
@ -1697,6 +1697,18 @@ void LocApiV02Adapter :: reportPosition (
|
||||||
locationExtended.altitudeMeanSeaLevel = location_report_ptr->altitudeWrtMeanSeaLevel;
|
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,
|
LocApiAdapter::reportPosition( location,
|
||||||
locationExtended,
|
locationExtended,
|
||||||
locEngHandle.extPosInfo((void*)location_report_ptr),
|
locEngHandle.extPosInfo((void*)location_report_ptr),
|
||||||
|
|
Loading…
Reference in a new issue