loc_api: Send position technology mask to ulp
Sends the technology mask of the position report to ulp and blocks the injected wifi fix from getting reported as final Change-Id: I3a9b390d3d6d9be1a913731d6e8d8ee1d3ced686
This commit is contained in:
parent
f2738552cc
commit
7ce61c42e2
7 changed files with 51 additions and 8 deletions
6
loc_api/libloc_api_50001/LocApiAdapter.cpp
Normal file → Executable file
6
loc_api/libloc_api_50001/LocApiAdapter.cpp
Normal file → Executable file
|
@ -114,12 +114,14 @@ int LocApiAdapter::decodeAddress(char *addr_string, int string_size,
|
|||
|
||||
void LocApiAdapter::reportPosition(GpsLocation &location,
|
||||
void* locationExt,
|
||||
enum loc_sess_status status)
|
||||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask )
|
||||
{
|
||||
loc_eng_msg_report_position *msg(new loc_eng_msg_report_position(locEngHandle.owner,
|
||||
location,
|
||||
locationExt,
|
||||
status));
|
||||
status,
|
||||
loc_technology_mask));
|
||||
if (locEngHandle.sendUlpMsg) {
|
||||
locEngHandle.sendUlpMsg(locEngHandle.owner, msg);
|
||||
} else {
|
||||
|
|
3
loc_api/libloc_api_50001/LocApiAdapter.h
Normal file → Executable file
3
loc_api/libloc_api_50001/LocApiAdapter.h
Normal file → Executable file
|
@ -122,7 +122,8 @@ public:
|
|||
|
||||
void reportPosition(GpsLocation &location,
|
||||
void* locationExt,
|
||||
enum loc_sess_status status);
|
||||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask = LOC_POS_TECH_MASK_DEFAULT);
|
||||
void reportSv(GpsSvStatus &svStatus, void* svExt);
|
||||
void reportStatus(GpsStatusValue status);
|
||||
void reportNmea(const char* nmea, int length);
|
||||
|
|
9
loc_api/libloc_api_50001/loc.h
Normal file → Executable file
9
loc_api/libloc_api_50001/loc.h
Normal file → Executable file
|
@ -80,6 +80,15 @@ enum loc_sess_status {
|
|||
LOC_SESS_FAILURE
|
||||
};
|
||||
|
||||
typedef uint32_t LocPosTechMask;
|
||||
#define LOC_POS_TECH_MASK_DEFAULT ((LocPosTechMask)0x00000000)
|
||||
#define LOC_POS_TECH_MASK_SATELLITE ((LocPosTechMask)0x00000001)
|
||||
#define LOC_POS_TECH_MASK_CELLID ((LocPosTechMask)0x00000002)
|
||||
#define LOC_POS_TECH_MASK_WIFI ((LocPosTechMask)0x00000004)
|
||||
#define LOC_POS_TECH_MASK_SENSORS ((LocPosTechMask)0x00000008)
|
||||
#define LOC_POS_TECH_MASK_REFERENCE_LOCATION ((LocPosTechMask)0x00000010)
|
||||
#define LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION ((LocPosTechMask)0x00000020)
|
||||
|
||||
void loc_ulp_msg_sender(void* loc_eng_data_p, void* msg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
10
loc_api/libloc_api_50001/loc_eng.cpp
Normal file → Executable file
10
loc_api/libloc_api_50001/loc_eng.cpp
Normal file → Executable file
|
@ -1484,13 +1484,21 @@ static void loc_eng_deferred_action_thread(void* arg)
|
|||
}
|
||||
// what's in the else if is... (line by line)
|
||||
// 1. this is a good fix; or
|
||||
// 1.1 there is source info; or
|
||||
// 1.1.1 this is from hybrid provider;
|
||||
// 1.2 it is a Satellite fix; or
|
||||
// 1.2.1 it is a sensor fix
|
||||
// 2. (must be intermediate fix... implicit)
|
||||
// 2.1 we accepte intermediate; and
|
||||
// 2.2 it is NOT the case that
|
||||
// 2.2.1 there is inaccuracy; and
|
||||
// 2.2.2 we care about inaccuracy; and
|
||||
// 2.2.3 the inaccuracy exceeds our tolerance
|
||||
else if (LOC_SESS_SUCCESS == rpMsg->status ||
|
||||
else if ((LOC_SESS_SUCCESS == rpMsg->status &&
|
||||
((LOCATION_HAS_SOURCE_INFO == rpMsg->location.flags &&
|
||||
ULP_LOCATION_IS_FROM_HYBRID == rpMsg->location.position_source) ||
|
||||
((LOC_POS_TECH_MASK_SATELLITE & rpMsg->technology_mask) ||
|
||||
(LOC_POS_TECH_MASK_SENSORS & rpMsg->technology_mask)))) ||
|
||||
(LOC_SESS_INTERMEDIATE == loc_eng_data_p->intermediateFix &&
|
||||
!((rpMsg->location.flags & GPS_LOCATION_HAS_ACCURACY) &&
|
||||
(gps_conf.ACCURACY_THRES != 0) &&
|
||||
|
|
17
loc_api/libloc_api_50001/loc_eng_msg.h
Normal file → Executable file
17
loc_api/libloc_api_50001/loc_eng_msg.h
Normal file → Executable file
|
@ -319,15 +319,26 @@ struct loc_eng_msg_report_position : public loc_eng_msg {
|
|||
const GpsLocation location;
|
||||
const void* locationExt;
|
||||
const enum loc_sess_status status;
|
||||
const LocPosTechMask technology_mask;
|
||||
inline loc_eng_msg_report_position(void* instance, GpsLocation &loc, void* locExt,
|
||||
enum loc_sess_status st) :
|
||||
loc_eng_msg(instance, LOC_ENG_MSG_REPORT_POSITION),
|
||||
location(loc), locationExt(locExt), status(st)
|
||||
location(loc), locationExt(locExt), status(st), technology_mask(LOC_POS_TECH_MASK_DEFAULT)
|
||||
{
|
||||
LOC_LOGV("flags: %d\n source: %d\n latitude: %f\n longitude: %f\n altitude: %f\n speed: %f\n bearing: %f\n accuracy: %f\n timestamp: %lld\n rawDataSize: %d\n rawData: %p\n Session status: %d",
|
||||
LOC_LOGV("flags: %d\n source: %d\n latitude: %f\n longitude: %f\n altitude: %f\n speed: %f\n bearing: %f\n accuracy: %f\n timestamp: %lld\n rawDataSize: %d\n rawData: %p\n Session status: %d\n Technology mask: %u",
|
||||
location.flags, location.position_source, location.latitude, location.longitude,
|
||||
location.altitude, location.speed, location.bearing, location.accuracy,
|
||||
location.timestamp, location.rawDataSize, location.rawData,status);
|
||||
location.timestamp, location.rawDataSize, location.rawData,status,technology_mask);
|
||||
}
|
||||
inline loc_eng_msg_report_position(void* instance, GpsLocation &loc, void* locExt,
|
||||
enum loc_sess_status st, LocPosTechMask technology) :
|
||||
loc_eng_msg(instance, LOC_ENG_MSG_REPORT_POSITION),
|
||||
location(loc), locationExt(locExt), status(st), technology_mask(technology)
|
||||
{
|
||||
LOC_LOGV("flags: %d\n source: %d\n latitude: %f\n longitude: %f\n altitude: %f\n speed: %f\n bearing: %f\n accuracy: %f\n timestamp: %lld\n rawDataSize: %d\n rawData: %p\n Session status: %d\n Technology mask: %u",
|
||||
location.flags, location.position_source, location.latitude, location.longitude,
|
||||
location.altitude, location.speed, location.bearing, location.accuracy,
|
||||
location.timestamp, location.rawDataSize, location.rawData,status,technology_mask);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
6
loc_api/libloc_api_50001/loc_eng_msg_id.h
Normal file → Executable file
6
loc_api/libloc_api_50001/loc_eng_msg_id.h
Normal file → Executable file
|
@ -115,6 +115,12 @@ enum loc_eng_msg_ids_t {
|
|||
// Message is sent by QUIPC module in order to request some info from ULP
|
||||
ULP_MSG_REQUEST_COARSE_POSITION,
|
||||
|
||||
// Message is sent to ULP module to re-evaluate its subsystems
|
||||
ULP_MSG_MONITOR,
|
||||
|
||||
// Last ULP MSG
|
||||
ULP_MSG_LAST = 0x700,
|
||||
|
||||
/* Message is sent by HAL to LOC API to configure LTE Positioning
|
||||
Profile in modem */
|
||||
LOC_ENG_MSG_LPP_CONFIG,
|
||||
|
|
8
loc_api/loc_api_v02/LocApiV02Adapter.cpp
Normal file → Executable file
8
loc_api/loc_api_v02/LocApiV02Adapter.cpp
Normal file → Executable file
|
@ -1550,6 +1550,7 @@ void LocApiV02Adapter :: reportPosition (
|
|||
const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr)
|
||||
{
|
||||
GpsLocation location;
|
||||
LocPosTechMask tech_Mask = LOC_POS_TECH_MASK_DEFAULT;
|
||||
LOC_LOGD("Reporting postion from V2 Adapter\n");
|
||||
memset(&location, 0, sizeof (GpsLocation));
|
||||
location.size = sizeof(location);
|
||||
|
@ -1607,6 +1608,10 @@ void LocApiV02Adapter :: reportPosition (
|
|||
location.flags |= GPS_LOCATION_HAS_ACCURACY;
|
||||
location.accuracy = location_report_ptr->horUncCircular;
|
||||
}
|
||||
|
||||
// Technology Mask
|
||||
tech_Mask |= location_report_ptr->technologyMask;
|
||||
|
||||
//Mark the location source as from GNSS
|
||||
location.flags |= LOCATION_HAS_SOURCE_INFO;
|
||||
location.position_source = ULP_LOCATION_IS_FROM_GNSS;
|
||||
|
@ -1614,7 +1619,8 @@ void LocApiV02Adapter :: reportPosition (
|
|||
locEngHandle.extPosInfo((void*)location_report_ptr),
|
||||
(location_report_ptr->sessionStatus
|
||||
== eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 ?
|
||||
LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS));
|
||||
LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS),
|
||||
tech_Mask);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue