Promotion of location.lnx.2.0-00040.
CRs Change ID Subject -------------------------------------------------------------------------------------------------------------- 1073101 Ie784dad73ae8d6d91cf4cb87efe938af9015a7a2 Reinitialize dataservice client post SSR 1080013 I98f3f4e7836de86f9025bae446cdeac6d1eb5862 Mark SV used_in_fix based on the most recent position re Change-Id: Ia31751b3b8909737b8c8d50eb96b1331da8f3c05 CRs-Fixed: 1080013, 1073101
This commit is contained in:
commit
539c17f2bb
6 changed files with 159 additions and 10 deletions
|
@ -237,13 +237,18 @@ void LocApiBase::reportPosition(UlpLocation &location,
|
||||||
LOC_LOGV("flags: %d\n source: %d\n latitude: %f\n longitude: %f\n "
|
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 "
|
"altitude: %f\n speed: %f\n bearing: %f\n accuracy: %f\n "
|
||||||
"timestamp: %lld\n rawDataSize: %d\n rawData: %p\n "
|
"timestamp: %lld\n rawDataSize: %d\n rawData: %p\n "
|
||||||
"Session status: %d\n Technology mask: %u",
|
"Session status: %d\n Technology mask: %u\n "
|
||||||
|
"SV used in fix (gps/glo/bds/gal) : (%x/%x/%x/%x)",
|
||||||
location.gpsLocation.flags, location.position_source,
|
location.gpsLocation.flags, location.position_source,
|
||||||
location.gpsLocation.latitude, location.gpsLocation.longitude,
|
location.gpsLocation.latitude, location.gpsLocation.longitude,
|
||||||
location.gpsLocation.altitude, location.gpsLocation.speed,
|
location.gpsLocation.altitude, location.gpsLocation.speed,
|
||||||
location.gpsLocation.bearing, location.gpsLocation.accuracy,
|
location.gpsLocation.bearing, location.gpsLocation.accuracy,
|
||||||
location.gpsLocation.timestamp, location.rawDataSize,
|
location.gpsLocation.timestamp, location.rawDataSize,
|
||||||
location.rawData, status, loc_technology_mask);
|
location.rawData, status, loc_technology_mask,
|
||||||
|
locationExtended.gnss_sv_used_ids.gps_sv_used_ids_mask,
|
||||||
|
locationExtended.gnss_sv_used_ids.glo_sv_used_ids_mask,
|
||||||
|
locationExtended.gnss_sv_used_ids.bds_sv_used_ids_mask,
|
||||||
|
locationExtended.gnss_sv_used_ids.gal_sv_used_ids_mask);
|
||||||
// loop through adapters, and deliver to all adapters.
|
// loop through adapters, and deliver to all adapters.
|
||||||
TO_ALL_LOCADAPTERS(
|
TO_ALL_LOCADAPTERS(
|
||||||
mLocAdapters[i]->reportPosition(location,
|
mLocAdapters[i]->reportPosition(location,
|
||||||
|
@ -549,7 +554,7 @@ enum loc_api_adapter_err LocApiBase::
|
||||||
}
|
}
|
||||||
|
|
||||||
int LocApiBase::
|
int LocApiBase::
|
||||||
initDataServiceClient()
|
initDataServiceClient(bool isDueToSsr)
|
||||||
DEFAULT_IMPL(-1)
|
DEFAULT_IMPL(-1)
|
||||||
|
|
||||||
int LocApiBase::
|
int LocApiBase::
|
||||||
|
@ -564,6 +569,10 @@ void LocApiBase::
|
||||||
closeDataCall()
|
closeDataCall()
|
||||||
DEFAULT_IMPL()
|
DEFAULT_IMPL()
|
||||||
|
|
||||||
|
void LocApiBase::
|
||||||
|
releaseDataServiceClient()
|
||||||
|
DEFAULT_IMPL()
|
||||||
|
|
||||||
int LocApiBase::
|
int LocApiBase::
|
||||||
setGpsLock(LOC_GPS_LOCK_MASK lock)
|
setGpsLock(LOC_GPS_LOCK_MASK lock)
|
||||||
DEFAULT_IMPL(-1)
|
DEFAULT_IMPL(-1)
|
||||||
|
|
|
@ -215,10 +215,11 @@ public:
|
||||||
getBestAvailableZppFix(GpsLocation & zppLoc);
|
getBestAvailableZppFix(GpsLocation & zppLoc);
|
||||||
virtual enum loc_api_adapter_err
|
virtual enum loc_api_adapter_err
|
||||||
getBestAvailableZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask);
|
getBestAvailableZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask);
|
||||||
virtual int initDataServiceClient();
|
virtual int initDataServiceClient(bool isDueToSsr);
|
||||||
virtual int openAndStartDataCall();
|
virtual int openAndStartDataCall();
|
||||||
virtual void stopDataCall();
|
virtual void stopDataCall();
|
||||||
virtual void closeDataCall();
|
virtual void closeDataCall();
|
||||||
|
virtual void releaseDataServiceClient();
|
||||||
virtual void installAGpsCert(const DerEncodedCertificate* pData,
|
virtual void installAGpsCert(const DerEncodedCertificate* pData,
|
||||||
size_t length,
|
size_t length,
|
||||||
uint32_t slotBitMask);
|
uint32_t slotBitMask);
|
||||||
|
|
|
@ -262,6 +262,18 @@ typedef uint16_t GpsLocationExtendedFlags;
|
||||||
#define GPS_LOCATION_EXTENDED_HAS_HOR_ELIP_UNC_MINOR 0x0400
|
#define GPS_LOCATION_EXTENDED_HAS_HOR_ELIP_UNC_MINOR 0x0400
|
||||||
/** GpsLocationExtended has valid Elliptical Horizontal Uncertainty Azimuth */
|
/** GpsLocationExtended has valid Elliptical Horizontal Uncertainty Azimuth */
|
||||||
#define GPS_LOCATION_EXTENDED_HAS_HOR_ELIP_UNC_AZIMUTH 0x0800
|
#define GPS_LOCATION_EXTENDED_HAS_HOR_ELIP_UNC_AZIMUTH 0x0800
|
||||||
|
/** GpsLocationExtended has valid gnss sv used in position data */
|
||||||
|
#define GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA 0x1000
|
||||||
|
|
||||||
|
/** GPS PRN Range */
|
||||||
|
#define GPS_SV_PRN_MIN 1
|
||||||
|
#define GPS_SV_PRN_MAX 32
|
||||||
|
#define GLO_SV_PRN_MIN 65
|
||||||
|
#define GLO_SV_PRN_MAX 96
|
||||||
|
#define BDS_SV_PRN_MIN 201
|
||||||
|
#define BDS_SV_PRN_MAX 235
|
||||||
|
#define GAL_SV_PRN_MIN 301
|
||||||
|
#define GAL_SV_PRN_MAX 336
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
LOC_RELIABILITY_NOT_SET = 0,
|
LOC_RELIABILITY_NOT_SET = 0,
|
||||||
|
@ -278,6 +290,13 @@ typedef struct {
|
||||||
/* timestamp uncertainty in milli seconds */
|
/* timestamp uncertainty in milli seconds */
|
||||||
}Gnss_ApTimeStampStructType;
|
}Gnss_ApTimeStampStructType;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint64_t gps_sv_used_ids_mask;
|
||||||
|
uint64_t glo_sv_used_ids_mask;
|
||||||
|
uint64_t gal_sv_used_ids_mask;
|
||||||
|
uint64_t bds_sv_used_ids_mask;
|
||||||
|
} GnssSvUsedInPosition;
|
||||||
|
|
||||||
/** Represents gps location extended. */
|
/** Represents gps location extended. */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/** set to sizeof(GpsLocationExtended) */
|
/** set to sizeof(GpsLocationExtended) */
|
||||||
|
@ -312,6 +331,8 @@ typedef struct {
|
||||||
float horUncEllipseOrientAzimuth;
|
float horUncEllipseOrientAzimuth;
|
||||||
|
|
||||||
Gnss_ApTimeStampStructType timeStamp;
|
Gnss_ApTimeStampStructType timeStamp;
|
||||||
|
/** Gnss sv used in position data */
|
||||||
|
GnssSvUsedInPosition gnss_sv_used_ids;
|
||||||
} GpsLocationExtended;
|
} GpsLocationExtended;
|
||||||
|
|
||||||
enum loc_sess_status {
|
enum loc_sess_status {
|
||||||
|
|
|
@ -81,6 +81,7 @@ LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask,
|
||||||
{
|
{
|
||||||
memset(&mFixCriteria, 0, sizeof(mFixCriteria));
|
memset(&mFixCriteria, 0, sizeof(mFixCriteria));
|
||||||
mFixCriteria.mode = LOC_POSITION_MODE_INVALID;
|
mFixCriteria.mode = LOC_POSITION_MODE_INVALID;
|
||||||
|
clearGnssSvUsedListData();
|
||||||
LOC_LOGD("LocEngAdapter created");
|
LOC_LOGD("LocEngAdapter created");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,9 @@ class LocEngAdapter : public LocAdapterBase {
|
||||||
unsigned int mPowerVote;
|
unsigned int mPowerVote;
|
||||||
static const unsigned int POWER_VOTE_RIGHT = 0x20;
|
static const unsigned int POWER_VOTE_RIGHT = 0x20;
|
||||||
static const unsigned int POWER_VOTE_VALUE = 0x10;
|
static const unsigned int POWER_VOTE_VALUE = 0x10;
|
||||||
|
/** Gnss sv used in position data */
|
||||||
|
GnssSvUsedInPosition mGnssSvIdUsedInPosition;
|
||||||
|
bool mGnssSvIdUsedInPosAvail;
|
||||||
public:
|
public:
|
||||||
bool mSupportsAgpsRequests;
|
bool mSupportsAgpsRequests;
|
||||||
bool mSupportsPositionInjection;
|
bool mSupportsPositionInjection;
|
||||||
|
@ -111,6 +113,25 @@ public:
|
||||||
}
|
}
|
||||||
inline const MsgTask* getMsgTask() { return mMsgTask; }
|
inline const MsgTask* getMsgTask() { return mMsgTask; }
|
||||||
|
|
||||||
|
inline void clearGnssSvUsedListData() {
|
||||||
|
mGnssSvIdUsedInPosAvail = false;
|
||||||
|
memset(&mGnssSvIdUsedInPosition, 0, sizeof (GnssSvUsedInPosition));
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void setGnssSvUsedListData(GnssSvUsedInPosition gnssSvUsedIds) {
|
||||||
|
mGnssSvIdUsedInPosAvail = true;
|
||||||
|
memcpy(&mGnssSvIdUsedInPosition, &gnssSvUsedIds,
|
||||||
|
sizeof(GnssSvUsedInPosition));
|
||||||
|
}
|
||||||
|
|
||||||
|
inline GnssSvUsedInPosition getGnssSvUsedListData() {
|
||||||
|
return mGnssSvIdUsedInPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool isGnssSvIdUsedInPosAvail() {
|
||||||
|
return mGnssSvIdUsedInPosAvail;
|
||||||
|
}
|
||||||
|
|
||||||
inline enum loc_api_adapter_err
|
inline enum loc_api_adapter_err
|
||||||
startFix()
|
startFix()
|
||||||
{
|
{
|
||||||
|
@ -240,9 +261,9 @@ public:
|
||||||
{
|
{
|
||||||
return mLocApi->setLPPeProtocol(lppeCP, lppeUP);
|
return mLocApi->setLPPeProtocol(lppeCP, lppeUP);
|
||||||
}
|
}
|
||||||
inline virtual int initDataServiceClient()
|
inline virtual int initDataServiceClient(bool isDueToSsr)
|
||||||
{
|
{
|
||||||
return mLocApi->initDataServiceClient();
|
return mLocApi->initDataServiceClient(isDueToSsr);
|
||||||
}
|
}
|
||||||
inline virtual int openAndStartDataCall()
|
inline virtual int openAndStartDataCall()
|
||||||
{
|
{
|
||||||
|
@ -256,6 +277,10 @@ public:
|
||||||
{
|
{
|
||||||
mLocApi->closeDataCall();
|
mLocApi->closeDataCall();
|
||||||
}
|
}
|
||||||
|
inline virtual void releaseDataServiceClient()
|
||||||
|
{
|
||||||
|
mLocApi->releaseDataServiceClient();
|
||||||
|
}
|
||||||
inline enum loc_api_adapter_err
|
inline enum loc_api_adapter_err
|
||||||
getZpp(GpsLocation &zppLoc, LocPosTechMask &tech_mask)
|
getZpp(GpsLocation &zppLoc, LocPosTechMask &tech_mask)
|
||||||
{
|
{
|
||||||
|
|
|
@ -186,6 +186,7 @@ static void loc_default_parameters(void)
|
||||||
// 2nd half of init(), singled out for
|
// 2nd half of init(), singled out for
|
||||||
// modem restart to use.
|
// modem restart to use.
|
||||||
static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data);
|
static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data);
|
||||||
|
static void loc_eng_dsclient_release(loc_eng_data_s_type &loc_eng_data);
|
||||||
static void loc_eng_agps_reinit(loc_eng_data_s_type &loc_eng_data);
|
static void loc_eng_agps_reinit(loc_eng_data_s_type &loc_eng_data);
|
||||||
|
|
||||||
static int loc_eng_set_server(loc_eng_data_s_type &loc_eng_data,
|
static int loc_eng_set_server(loc_eng_data_s_type &loc_eng_data,
|
||||||
|
@ -290,6 +291,7 @@ LocEngStopFix::LocEngStopFix(LocEngAdapter* adapter) :
|
||||||
inline void LocEngStopFix::proc() const
|
inline void LocEngStopFix::proc() const
|
||||||
{
|
{
|
||||||
loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mAdapter->getOwner();
|
loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mAdapter->getOwner();
|
||||||
|
mAdapter->clearGnssSvUsedListData();
|
||||||
loc_eng_stop_handler(*locEng);
|
loc_eng_stop_handler(*locEng);
|
||||||
}
|
}
|
||||||
inline void LocEngStopFix::locallog() const
|
inline void LocEngStopFix::locallog() const
|
||||||
|
@ -806,6 +808,10 @@ void LocEngReportPosition::proc() const {
|
||||||
(gps_conf.ACCURACY_THRES != 0) &&
|
(gps_conf.ACCURACY_THRES != 0) &&
|
||||||
(mLocation.gpsLocation.accuracy >
|
(mLocation.gpsLocation.accuracy >
|
||||||
gps_conf.ACCURACY_THRES)))) {
|
gps_conf.ACCURACY_THRES)))) {
|
||||||
|
if (mLocationExtended.flags & GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA)
|
||||||
|
{
|
||||||
|
adapter->setGnssSvUsedListData(mLocationExtended.gnss_sv_used_ids);
|
||||||
|
}
|
||||||
locEng->location_cb((UlpLocation*)&(mLocation),
|
locEng->location_cb((UlpLocation*)&(mLocation),
|
||||||
(void*)mLocationExt);
|
(void*)mLocationExt);
|
||||||
reported = true;
|
reported = true;
|
||||||
|
@ -880,14 +886,61 @@ void LocEngReportSv::proc() const {
|
||||||
|
|
||||||
if (locEng->mute_session_state != LOC_MUTE_SESS_IN_SESSION)
|
if (locEng->mute_session_state != LOC_MUTE_SESS_IN_SESSION)
|
||||||
{
|
{
|
||||||
|
GnssSvStatus gnssSvStatus;
|
||||||
|
memcpy(&gnssSvStatus,&mSvStatus,sizeof(GnssSvStatus));
|
||||||
|
if (adapter->isGnssSvIdUsedInPosAvail())
|
||||||
|
{
|
||||||
|
GnssSvUsedInPosition gnssSvIdUsedInPosition =
|
||||||
|
adapter->getGnssSvUsedListData();
|
||||||
|
int numSv = gnssSvStatus.num_svs;
|
||||||
|
int16_t gnssSvId = 0;
|
||||||
|
int prnMin = 0;
|
||||||
|
uint64_t svUsedIdMask = 0;
|
||||||
|
for (int i=0; i < numSv; i++)
|
||||||
|
{
|
||||||
|
gnssSvId = gnssSvStatus.gnss_sv_list[i].svid;
|
||||||
|
if (gnssSvId <= GPS_SV_PRN_MAX)
|
||||||
|
{
|
||||||
|
svUsedIdMask = gnssSvIdUsedInPosition.gps_sv_used_ids_mask;
|
||||||
|
prnMin = GPS_SV_PRN_MIN;
|
||||||
|
}
|
||||||
|
else if ((gnssSvId >= GLO_SV_PRN_MIN) && (gnssSvId <= GLO_SV_PRN_MAX))
|
||||||
|
{
|
||||||
|
svUsedIdMask = gnssSvIdUsedInPosition.glo_sv_used_ids_mask;
|
||||||
|
prnMin = GLO_SV_PRN_MIN;
|
||||||
|
}
|
||||||
|
else if ((gnssSvId >= BDS_SV_PRN_MIN) && (gnssSvId <= BDS_SV_PRN_MAX))
|
||||||
|
{
|
||||||
|
svUsedIdMask = gnssSvIdUsedInPosition.bds_sv_used_ids_mask;
|
||||||
|
prnMin = BDS_SV_PRN_MIN;
|
||||||
|
}
|
||||||
|
else if ((gnssSvId >= GAL_SV_PRN_MIN) && (gnssSvId <= GAL_SV_PRN_MAX))
|
||||||
|
{
|
||||||
|
svUsedIdMask = gnssSvIdUsedInPosition.gal_sv_used_ids_mask;
|
||||||
|
prnMin = GAL_SV_PRN_MIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If SV ID was used in previous position fix, then set USED_IN_FIX
|
||||||
|
// flag, else clear the USED_IN_FIX flag.
|
||||||
|
if (svUsedIdMask & (1 << (gnssSvId - prnMin)))
|
||||||
|
{
|
||||||
|
gnssSvStatus.gnss_sv_list[i].flags |= GNSS_SV_FLAGS_USED_IN_FIX;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gnssSvStatus.gnss_sv_list[i].flags &= ~GNSS_SV_FLAGS_USED_IN_FIX;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (locEng->gnss_sv_status_cb != NULL) {
|
if (locEng->gnss_sv_status_cb != NULL) {
|
||||||
LOC_LOGE("Calling gnss_sv_status_cb");
|
LOC_LOGE("Calling gnss_sv_status_cb");
|
||||||
locEng->gnss_sv_status_cb((GnssSvStatus*)&(mSvStatus));
|
locEng->gnss_sv_status_cb((GnssSvStatus*)&(gnssSvStatus));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (locEng->generateNmea)
|
if (locEng->generateNmea)
|
||||||
{
|
{
|
||||||
loc_eng_nmea_generate_sv(locEng, mSvStatus, mLocationExtended);
|
loc_eng_nmea_generate_sv(locEng, gnssSvStatus, mLocationExtended);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2308,6 +2361,39 @@ static void loc_eng_agps_reinit(loc_eng_data_s_type &loc_eng_data)
|
||||||
}
|
}
|
||||||
EXIT_LOG(%s, VOID_RET);
|
EXIT_LOG(%s, VOID_RET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*===========================================================================
|
||||||
|
FUNCTION loc_eng_dsclient_release
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
Stop/Close/Release DS client when modem SSR happens.
|
||||||
|
|
||||||
|
DEPENDENCIES
|
||||||
|
NONE
|
||||||
|
|
||||||
|
RETURN VALUE
|
||||||
|
0
|
||||||
|
|
||||||
|
SIDE EFFECTS
|
||||||
|
N/A
|
||||||
|
|
||||||
|
===========================================================================*/
|
||||||
|
static void loc_eng_dsclient_release(loc_eng_data_s_type &loc_eng_data)
|
||||||
|
{
|
||||||
|
ENTRY_LOG();
|
||||||
|
int result = 1;
|
||||||
|
LocEngAdapter* adapter = loc_eng_data.adapter;
|
||||||
|
if (NULL != adapter && gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL)
|
||||||
|
{
|
||||||
|
// stop and close the ds client
|
||||||
|
adapter->stopDataCall();
|
||||||
|
adapter->closeDataCall();
|
||||||
|
adapter->releaseDataServiceClient();
|
||||||
|
}
|
||||||
|
EXIT_LOG(%s, VOID_RET);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
FUNCTION loc_eng_agps_init
|
FUNCTION loc_eng_agps_init
|
||||||
|
|
||||||
|
@ -2378,7 +2464,7 @@ static void createAgnssNifs(loc_eng_data_s_type& locEng) {
|
||||||
}
|
}
|
||||||
if (NULL == locEng.ds_nif &&
|
if (NULL == locEng.ds_nif &&
|
||||||
gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL &&
|
gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL &&
|
||||||
0 == adapter->initDataServiceClient()) {
|
0 == adapter->initDataServiceClient(false)) {
|
||||||
locEng.ds_nif = new DSStateMachine(servicerTypeExt,
|
locEng.ds_nif = new DSStateMachine(servicerTypeExt,
|
||||||
(void *)dataCallCb,
|
(void *)dataCallCb,
|
||||||
locEng.adapter);
|
locEng.adapter);
|
||||||
|
@ -2912,6 +2998,12 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data)
|
||||||
if (loc_eng_data.internet_nif)
|
if (loc_eng_data.internet_nif)
|
||||||
loc_eng_data.internet_nif->dropAllSubscribers();
|
loc_eng_data.internet_nif->dropAllSubscribers();
|
||||||
|
|
||||||
|
// reinitialize DS client in SSR mode
|
||||||
|
loc_eng_dsclient_release(loc_eng_data);
|
||||||
|
if (loc_eng_data.adapter->mSupportsAgpsRequests &&
|
||||||
|
gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) {
|
||||||
|
loc_eng_data.adapter->initDataServiceClient(true);
|
||||||
|
}
|
||||||
loc_eng_agps_reinit(loc_eng_data);
|
loc_eng_agps_reinit(loc_eng_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue