gps: use single recurrence for MSA requests
To allow ulp to select MSA for single shot location requests, change the recurrence type for MSA requests to SINGLE. CRs-fixed: 479303 Change-Id: I97043233e0590b25bc63f3709b2bbb3dfd22cbd0
This commit is contained in:
parent
3bba831981
commit
38474f1f1d
2 changed files with 10 additions and 2 deletions
|
@ -419,7 +419,8 @@ static int loc_stop()
|
|||
ULP_CRITERIA_HAS_MIN_INTERVAL);
|
||||
native_criteria.provider_source = ULP_PROVIDER_SOURCE_GNSS;
|
||||
native_criteria.min_distance = 0; //This is not used by ULP engine so leaving it 0 for now
|
||||
native_criteria.recurrence_type = ULP_LOC_RECURRENCE_PERIODIC; //We let LMS handle SingleShot
|
||||
native_criteria.recurrence_type = loc_afw_data.recurrence_type_cached;
|
||||
loc_afw_data.recurrence_type_cached = ULP_LOC_RECURRENCE_PERIODIC;
|
||||
//For a GPS client horizontal_accuracy & power_consumption are irrelevant
|
||||
native_criteria.preferred_horizontal_accuracy = ULP_HORZ_ACCURACY_DONT_CARE;
|
||||
native_criteria.preferred_power_consumption = ULP_POWER_REQ_DONT_CARE;
|
||||
|
@ -482,13 +483,19 @@ static int loc_set_position_mode(GpsPositionMode mode,
|
|||
ULP_CRITERIA_HAS_MIN_INTERVAL);
|
||||
native_criteria.provider_source = ULP_PROVIDER_SOURCE_GNSS;
|
||||
native_criteria.min_distance = 0; //This is not used by ULP engine so leaving it 0 for now
|
||||
native_criteria.recurrence_type = ULP_LOC_RECURRENCE_PERIODIC; //We let LMS handle SingleShot
|
||||
|
||||
if (LOC_POSITION_MODE_MS_ASSISTED == mode)
|
||||
native_criteria.recurrence_type = ULP_LOC_RECURRENCE_SINGLE;
|
||||
else
|
||||
native_criteria.recurrence_type = ULP_LOC_RECURRENCE_PERIODIC;
|
||||
|
||||
//For a GPS client horizontal_accuracy & power_consumption are irrelevant
|
||||
native_criteria.preferred_horizontal_accuracy = ULP_HORZ_ACCURACY_DONT_CARE;
|
||||
native_criteria.preferred_power_consumption = ULP_POWER_REQ_DONT_CARE;
|
||||
native_criteria.action = ULP_ADD_CRITERIA;
|
||||
native_criteria.min_interval = min_interval;
|
||||
loc_afw_data.min_interval_cached = min_interval; //cache a copy
|
||||
loc_afw_data.recurrence_type_cached = native_criteria.recurrence_type; //cache a copy
|
||||
ret_val = loc_eng_update_criteria(loc_afw_data, native_criteria);
|
||||
}
|
||||
|
||||
|
|
|
@ -153,6 +153,7 @@ typedef struct
|
|||
int mpc_port_buf;
|
||||
bool ulp_initialized;
|
||||
uint32_t min_interval_cached;
|
||||
UlpRecurrenceCriteria recurrence_type_cached;
|
||||
} loc_eng_data_s_type;
|
||||
|
||||
#include "ulp.h"
|
||||
|
|
Loading…
Reference in a new issue