Addition of new LocApi thread
1. LocApiBase to create its own MsgTask thread to allow QMI calls to be made asynchronously. It shall no longer share the adapter's thread. 2. Implementation of new LocApiResponse classes for generic response type from LocApi layer to Adapter layers 3. GnssAdapter modified to handle the asynchronous nature of LocApi calls. CRs-Fixed: 2218658 Change-Id: I6e401a89f16791ec144763ac5f070b7ee1dad931
This commit is contained in:
parent
94904a7184
commit
f6b613a827
12 changed files with 842 additions and 557 deletions
|
@ -42,6 +42,10 @@ namespace loc_core {
|
||||||
|
|
||||||
loc_gps_cfg_s_type ContextBase::mGps_conf {};
|
loc_gps_cfg_s_type ContextBase::mGps_conf {};
|
||||||
loc_sap_cfg_s_type ContextBase::mSap_conf {};
|
loc_sap_cfg_s_type ContextBase::mSap_conf {};
|
||||||
|
bool ContextBase::sIsEngineCapabilitiesKnown = false;
|
||||||
|
uint64_t ContextBase::sSupportedMsgMask = 0;
|
||||||
|
bool ContextBase::sGnssMeasurementSupported = false;
|
||||||
|
uint8_t ContextBase::sFeaturesSupported[MAX_FEATURE_LENGTH];
|
||||||
|
|
||||||
const loc_param_s_type ContextBase::mGps_conf_table[] =
|
const loc_param_s_type ContextBase::mGps_conf_table[] =
|
||||||
{
|
{
|
||||||
|
@ -215,7 +219,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask)
|
||||||
// Check the target
|
// Check the target
|
||||||
if (TARGET_NO_GNSS != loc_get_target()){
|
if (TARGET_NO_GNSS != loc_get_target()){
|
||||||
|
|
||||||
if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask, this))) {
|
if (NULL == (locApi = mLBSProxy->getLocApi(exMask, this))) {
|
||||||
void *handle = NULL;
|
void *handle = NULL;
|
||||||
//try to see if LocApiV02 is present
|
//try to see if LocApiV02 is present
|
||||||
if ((handle = dlopen("libloc_api_v02.so", RTLD_NOW)) != NULL) {
|
if ((handle = dlopen("libloc_api_v02.so", RTLD_NOW)) != NULL) {
|
||||||
|
@ -224,7 +228,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask)
|
||||||
if (getter != NULL) {
|
if (getter != NULL) {
|
||||||
LOC_LOGD("%s:%d]: getter is not NULL for LocApiV02", __func__,
|
LOC_LOGD("%s:%d]: getter is not NULL for LocApiV02", __func__,
|
||||||
__LINE__);
|
__LINE__);
|
||||||
locApi = (*getter)(mMsgTask, exMask, this);
|
locApi = (*getter)(exMask, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// only RPC is the option now
|
// only RPC is the option now
|
||||||
|
@ -237,7 +241,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask)
|
||||||
if (NULL != getter) {
|
if (NULL != getter) {
|
||||||
LOC_LOGD("%s:%d]: getter is not NULL in RPC", __func__,
|
LOC_LOGD("%s:%d]: getter is not NULL in RPC", __func__,
|
||||||
__LINE__);
|
__LINE__);
|
||||||
locApi = (*getter)(mMsgTask, exMask, this);
|
locApi = (*getter)(exMask, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -247,7 +251,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask)
|
||||||
// locApi could still be NULL at this time
|
// locApi could still be NULL at this time
|
||||||
// we would then create a dummy one
|
// we would then create a dummy one
|
||||||
if (NULL == locApi) {
|
if (NULL == locApi) {
|
||||||
locApi = new LocApiBase(mMsgTask, exMask, this);
|
locApi = new LocApiBase(exMask, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
return locApi;
|
return locApi;
|
||||||
|
@ -263,4 +267,33 @@ ContextBase::ContextBase(const MsgTask* msgTask,
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ContextBase::setEngineCapabilities(uint64_t supportedMsgMask,
|
||||||
|
uint8_t *featureList, bool gnssMeasurementSupported) {
|
||||||
|
|
||||||
|
if (ContextBase::sIsEngineCapabilitiesKnown == false) {
|
||||||
|
ContextBase::sSupportedMsgMask = supportedMsgMask;
|
||||||
|
ContextBase::sGnssMeasurementSupported = gnssMeasurementSupported;
|
||||||
|
if (featureList != NULL) {
|
||||||
|
memcpy((void *)ContextBase::sFeaturesSupported,
|
||||||
|
(void *)featureList, sizeof(ContextBase::sFeaturesSupported));
|
||||||
|
}
|
||||||
|
|
||||||
|
ContextBase::sIsEngineCapabilitiesKnown = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool ContextBase::isFeatureSupported(uint8_t featureVal)
|
||||||
|
{
|
||||||
|
uint8_t arrayIndex = featureVal >> 3;
|
||||||
|
uint8_t bitPos = featureVal & 7;
|
||||||
|
|
||||||
|
if (arrayIndex >= MAX_FEATURE_LENGTH) return false;
|
||||||
|
return ((ContextBase::sFeaturesSupported[arrayIndex] >> bitPos ) & 0x1);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ContextBase::gnssConstellationConfig() {
|
||||||
|
return sGnssMeasurementSupported;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,6 +116,7 @@ protected:
|
||||||
const MsgTask* mMsgTask;
|
const MsgTask* mMsgTask;
|
||||||
LocApiBase* mLocApi;
|
LocApiBase* mLocApi;
|
||||||
LocApiProxyBase *mLocApiProxy;
|
LocApiProxyBase *mLocApiProxy;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ContextBase(const MsgTask* msgTask,
|
ContextBase(const MsgTask* msgTask,
|
||||||
LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
||||||
|
@ -140,12 +141,111 @@ public:
|
||||||
|
|
||||||
static loc_gps_cfg_s_type mGps_conf;
|
static loc_gps_cfg_s_type mGps_conf;
|
||||||
static loc_sap_cfg_s_type mSap_conf;
|
static loc_sap_cfg_s_type mSap_conf;
|
||||||
|
static bool sIsEngineCapabilitiesKnown;
|
||||||
|
static uint64_t sSupportedMsgMask;
|
||||||
|
static uint8_t sFeaturesSupported[MAX_FEATURE_LENGTH];
|
||||||
|
static bool sGnssMeasurementSupported;
|
||||||
|
|
||||||
void readConfig();
|
void readConfig();
|
||||||
static uint32_t getCarrierCapabilities();
|
static uint32_t getCarrierCapabilities();
|
||||||
|
void setEngineCapabilities(uint64_t supportedMsgMask,
|
||||||
|
uint8_t *featureList, bool gnssMeasurementSupported);
|
||||||
|
|
||||||
|
static inline bool isEngineCapabilitiesKnown() {
|
||||||
|
return sIsEngineCapabilitiesKnown;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool isMessageSupported(LocCheckingMessagesID msgID) {
|
||||||
|
|
||||||
|
// confirm if msgID is not larger than the number of bits in
|
||||||
|
// mSupportedMsg
|
||||||
|
if ((uint64_t)msgID > (sizeof(sSupportedMsgMask) << 3)) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
uint32_t messageChecker = 1 << msgID;
|
||||||
|
return (messageChecker & sSupportedMsgMask) == messageChecker;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Check if a feature is supported
|
||||||
|
*/
|
||||||
|
static bool isFeatureSupported(uint8_t featureVal);
|
||||||
|
|
||||||
|
/*
|
||||||
|
Check if gnss measurement is supported
|
||||||
|
*/
|
||||||
|
static bool gnssConstellationConfig();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct LocApiResponse: LocMsg {
|
||||||
|
private:
|
||||||
|
ContextBase& mContext;
|
||||||
|
std::function<void (LocationError err)> mProcImpl;
|
||||||
|
inline virtual void proc() const {
|
||||||
|
mProcImpl(mLocationError);
|
||||||
|
}
|
||||||
|
protected:
|
||||||
|
LocationError mLocationError;
|
||||||
|
public:
|
||||||
|
inline LocApiResponse(ContextBase& context,
|
||||||
|
std::function<void (LocationError err)> procImpl ) :
|
||||||
|
mContext(context), mProcImpl(procImpl) {}
|
||||||
|
|
||||||
|
void returnToSender(const LocationError err) {
|
||||||
|
mLocationError = err;
|
||||||
|
mContext.sendMsg(this);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct LocApiCollectiveResponse: LocMsg {
|
||||||
|
private:
|
||||||
|
ContextBase& mContext;
|
||||||
|
std::function<void (std::vector<LocationError> errs)> mProcImpl;
|
||||||
|
inline virtual void proc() const {
|
||||||
|
mProcImpl(mLocationErrors);
|
||||||
|
}
|
||||||
|
protected:
|
||||||
|
std::vector<LocationError> mLocationErrors;
|
||||||
|
public:
|
||||||
|
inline LocApiCollectiveResponse(ContextBase& context,
|
||||||
|
std::function<void (std::vector<LocationError> errs)> procImpl ) :
|
||||||
|
mContext(context), mProcImpl(procImpl) {}
|
||||||
|
inline virtual ~LocApiCollectiveResponse() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void returnToSender(std::vector<LocationError>& errs) {
|
||||||
|
mLocationErrors = errs;
|
||||||
|
mContext.sendMsg(this);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
template <typename DATA>
|
||||||
|
struct LocApiResponseData: LocMsg {
|
||||||
|
private:
|
||||||
|
ContextBase& mContext;
|
||||||
|
std::function<void (LocationError err, DATA data)> mProcImpl;
|
||||||
|
inline virtual void proc() const {
|
||||||
|
mProcImpl(mLocationError, mData);
|
||||||
|
}
|
||||||
|
protected:
|
||||||
|
LocationError mLocationError;
|
||||||
|
DATA mData;
|
||||||
|
public:
|
||||||
|
inline LocApiResponseData(ContextBase& context,
|
||||||
|
std::function<void (LocationError err, DATA data)> procImpl ) :
|
||||||
|
mContext(context), mProcImpl(procImpl) {}
|
||||||
|
|
||||||
|
void returnToSender(const LocationError err, const DATA data) {
|
||||||
|
mLocationError = err;
|
||||||
|
mData = data;
|
||||||
|
mContext.sendMsg(this);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
} // namespace loc_core
|
} // namespace loc_core
|
||||||
|
|
||||||
#endif //__LOC_CONTEXT_BASE__
|
#endif //__LOC_CONTEXT_BASE__
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#ifndef IZAT_PROXY_BASE_H
|
#ifndef IZAT_PROXY_BASE_H
|
||||||
#define IZAT_PROXY_BASE_H
|
#define IZAT_PROXY_BASE_H
|
||||||
#include <gps_extended.h>
|
#include <gps_extended.h>
|
||||||
#include <MsgTask.h>
|
|
||||||
|
|
||||||
namespace loc_core {
|
namespace loc_core {
|
||||||
|
|
||||||
|
@ -40,11 +39,9 @@ class ContextBase;
|
||||||
class LBSProxyBase {
|
class LBSProxyBase {
|
||||||
friend class ContextBase;
|
friend class ContextBase;
|
||||||
inline virtual LocApiBase*
|
inline virtual LocApiBase*
|
||||||
getLocApi(const MsgTask* msgTask,
|
getLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
||||||
LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
|
||||||
ContextBase* context) const {
|
ContextBase* context) const {
|
||||||
|
|
||||||
(void)msgTask;
|
|
||||||
(void)exMask;
|
(void)exMask;
|
||||||
(void)context;
|
(void)context;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -162,4 +162,10 @@ bool LocAdapterBase::
|
||||||
reportWwanZppFix(LocGpsLocation &/*zppLoc*/)
|
reportWwanZppFix(LocGpsLocation &/*zppLoc*/)
|
||||||
DEFAULT_IMPL(false)
|
DEFAULT_IMPL(false)
|
||||||
|
|
||||||
|
bool LocAdapterBase::
|
||||||
|
reportZppBestAvailableFix(LocGpsLocation& /*zppLoc*/,
|
||||||
|
GpsLocationExtended& /*location_extended*/, LocPosTechMask /*tech_mask*/)
|
||||||
|
DEFAULT_IMPL(false)
|
||||||
|
|
||||||
|
|
||||||
} // namespace loc_core
|
} // namespace loc_core
|
||||||
|
|
|
@ -107,7 +107,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool isFeatureSupported(uint8_t featureVal) {
|
inline bool isFeatureSupported(uint8_t featureVal) {
|
||||||
return mLocApi->isFeatureSupported(featureVal);
|
return ContextBase::isFeatureSupported(featureVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t generateSessionId();
|
uint32_t generateSessionId();
|
||||||
|
@ -155,6 +155,8 @@ public:
|
||||||
virtual void reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurements,
|
virtual void reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurements,
|
||||||
int msInWeek);
|
int msInWeek);
|
||||||
virtual bool reportWwanZppFix(LocGpsLocation &zppLoc);
|
virtual bool reportWwanZppFix(LocGpsLocation &zppLoc);
|
||||||
|
virtual bool reportZppBestAvailableFix(LocGpsLocation &zppLoc,
|
||||||
|
GpsLocationExtended &location_extended, LocPosTechMask tech_mask);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace loc_core
|
} // namespace loc_core
|
||||||
|
|
|
@ -126,14 +126,36 @@ struct LocOpenMsg : public LocMsg {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
LocApiBase::LocApiBase(const MsgTask* msgTask,
|
struct LocCloseMsg : public LocMsg {
|
||||||
LOC_API_ADAPTER_EVENT_MASK_T excludedMask,
|
LocApiBase* mLocApi;
|
||||||
|
inline LocCloseMsg(LocApiBase* locApi) :
|
||||||
|
LocMsg(), mLocApi(locApi)
|
||||||
|
{
|
||||||
|
locallog();
|
||||||
|
}
|
||||||
|
inline virtual void proc() const {
|
||||||
|
mLocApi->close();
|
||||||
|
}
|
||||||
|
inline void locallog() const {
|
||||||
|
LOC_LOGV("%s]: LocCloseMsg");
|
||||||
|
}
|
||||||
|
inline virtual void log() const {
|
||||||
|
locallog();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
MsgTask* LocApiBase::mMsgTask;
|
||||||
|
|
||||||
|
LocApiBase::LocApiBase(LOC_API_ADAPTER_EVENT_MASK_T excludedMask,
|
||||||
ContextBase* context) :
|
ContextBase* context) :
|
||||||
mMsgTask(msgTask), mContext(context), mSupportedMsg(0),
|
mContext(context),
|
||||||
mMask(0), mExcludedMask(excludedMask)
|
mMask(0), mExcludedMask(excludedMask)
|
||||||
{
|
{
|
||||||
memset(mLocAdapters, 0, sizeof(mLocAdapters));
|
memset(mLocAdapters, 0, sizeof(mLocAdapters));
|
||||||
memset(mFeaturesSupported, 0, sizeof(mFeaturesSupported));
|
|
||||||
|
if (nullptr == mMsgTask) {
|
||||||
|
mMsgTask = new MsgTask("LocApiMsgTask", false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOC_API_ADAPTER_EVENT_MASK_T LocApiBase::getEvtMask()
|
LOC_API_ADAPTER_EVENT_MASK_T LocApiBase::getEvtMask()
|
||||||
|
@ -197,7 +219,7 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter)
|
||||||
|
|
||||||
// if we have an empty list of adapters
|
// if we have an empty list of adapters
|
||||||
if (0 == i) {
|
if (0 == i) {
|
||||||
close();
|
mMsgTask->sendMsg(new LocCloseMsg(this));
|
||||||
} else {
|
} else {
|
||||||
// else we need to remove the bit
|
// else we need to remove the bit
|
||||||
mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask()));
|
mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask()));
|
||||||
|
@ -208,14 +230,11 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter)
|
||||||
|
|
||||||
void LocApiBase::updateEvtMask()
|
void LocApiBase::updateEvtMask()
|
||||||
{
|
{
|
||||||
open(getEvtMask());
|
mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocApiBase::handleEngineUpEvent()
|
void LocApiBase::handleEngineUpEvent()
|
||||||
{
|
{
|
||||||
// This will take care of renegotiating the loc handle
|
|
||||||
mMsgTask->sendMsg(new LocSsrMsg(this));
|
|
||||||
|
|
||||||
LocDualContext::injectFeatureConfig(mContext);
|
LocDualContext::injectFeatureConfig(mContext);
|
||||||
|
|
||||||
// loop through adapters, and deliver to all adapters.
|
// loop through adapters, and deliver to all adapters.
|
||||||
|
@ -223,7 +242,9 @@ void LocApiBase::handleEngineUpEvent()
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocApiBase::handleEngineDownEvent()
|
void LocApiBase::handleEngineDownEvent()
|
||||||
{
|
{ // This will take care of renegotiating the loc handle
|
||||||
|
sendMsg(new LocSsrMsg(this));
|
||||||
|
|
||||||
// loop through adapters, and deliver to all adapters.
|
// loop through adapters, and deliver to all adapters.
|
||||||
TO_ALL_LOCADAPTERS(mLocAdapters[i]->handleEngineDownEvent());
|
TO_ALL_LOCADAPTERS(mLocAdapters[i]->handleEngineDownEvent());
|
||||||
}
|
}
|
||||||
|
@ -239,7 +260,7 @@ void LocApiBase::reportPosition(UlpLocation& location,
|
||||||
"timestamp: %" PRId64 "\n"
|
"timestamp: %" PRId64 "\n"
|
||||||
"Session status: %d\n Technology mask: %u\n "
|
"Session status: %d\n Technology mask: %u\n "
|
||||||
"SV used in fix (gps/glo/bds/gal/qzss) : \
|
"SV used in fix (gps/glo/bds/gal/qzss) : \
|
||||||
(%" PRIx64 "/%" PRIx64 "/%" PRIx64 "/%" PRIx64 "/%" PRIx64 ")",
|
(0x%" PRIx64 "/0x%" PRIx64 "/0x%" PRIx64 "/0x%" PRIx64 "/0x%" PRIx64 ")",
|
||||||
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,
|
||||||
|
@ -263,6 +284,15 @@ void LocApiBase::reportWwanZppFix(LocGpsLocation &zppLoc)
|
||||||
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportWwanZppFix(zppLoc));
|
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportWwanZppFix(zppLoc));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LocApiBase::reportZppBestAvailableFix(LocGpsLocation &zppLoc,
|
||||||
|
GpsLocationExtended &location_extended, LocPosTechMask tech_mask)
|
||||||
|
{
|
||||||
|
// loop through adapters, and deliver to the first handling adapter.
|
||||||
|
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportZppBestAvailableFix(zppLoc,
|
||||||
|
location_extended, tech_mask));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void LocApiBase::reportSv(GnssSvNotification& svNotify)
|
void LocApiBase::reportSv(GnssSvNotification& svNotify)
|
||||||
{
|
{
|
||||||
const char* constellationString[] = { "Unknown", "GPS", "SBAS", "GLONASS",
|
const char* constellationString[] = { "Unknown", "GPS", "SBAS", "GLONASS",
|
||||||
|
@ -384,16 +414,6 @@ void LocApiBase::requestNiNotify(GnssNiNotification ¬ify, const void* data)
|
||||||
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotifyEvent(notify, data));
|
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotifyEvent(notify, data));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocApiBase::saveSupportedMsgList(uint64_t supportedMsgList)
|
|
||||||
{
|
|
||||||
mSupportedMsg = supportedMsgList;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LocApiBase::saveSupportedFeatureList(uint8_t *featureList)
|
|
||||||
{
|
|
||||||
memcpy((void *)mFeaturesSupported, (void *)featureList, sizeof(mFeaturesSupported));
|
|
||||||
}
|
|
||||||
|
|
||||||
void* LocApiBase :: getSibling()
|
void* LocApiBase :: getSibling()
|
||||||
DEFAULT_IMPL(NULL)
|
DEFAULT_IMPL(NULL)
|
||||||
|
|
||||||
|
@ -415,86 +435,72 @@ enum loc_api_adapter_err LocApiBase::
|
||||||
close()
|
close()
|
||||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||||
|
|
||||||
enum loc_api_adapter_err LocApiBase::
|
void LocApiBase::startFix(const LocPosMode& /*posMode*/, LocApiResponse* /*adapterResponse*/)
|
||||||
startFix(const LocPosMode& /*posMode*/)
|
DEFAULT_IMPL()
|
||||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
|
||||||
|
|
||||||
enum loc_api_adapter_err LocApiBase::
|
void LocApiBase::stopFix(LocApiResponse* /*adapterResponse*/)
|
||||||
stopFix()
|
DEFAULT_IMPL()
|
||||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
|
||||||
|
|
||||||
LocationError LocApiBase::
|
void LocApiBase::
|
||||||
deleteAidingData(const GnssAidingData& /*data*/)
|
deleteAidingData(const GnssAidingData& /*data*/, LocApiResponse* /*adapterResponse*/)
|
||||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
DEFAULT_IMPL()
|
||||||
|
|
||||||
enum loc_api_adapter_err LocApiBase::
|
void LocApiBase::
|
||||||
enableData(int /*enable*/)
|
|
||||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
|
||||||
|
|
||||||
enum loc_api_adapter_err LocApiBase::
|
|
||||||
setAPN(char* /*apn*/, int /*len*/)
|
|
||||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
|
||||||
|
|
||||||
enum loc_api_adapter_err LocApiBase::
|
|
||||||
injectPosition(double /*latitude*/, double /*longitude*/, float /*accuracy*/)
|
injectPosition(double /*latitude*/, double /*longitude*/, float /*accuracy*/)
|
||||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
DEFAULT_IMPL()
|
||||||
|
|
||||||
enum loc_api_adapter_err LocApiBase::
|
void LocApiBase::
|
||||||
setTime(LocGpsUtcTime /*time*/, int64_t /*timeReference*/, int /*uncertainty*/)
|
setTime(LocGpsUtcTime /*time*/, int64_t /*timeReference*/, int /*uncertainty*/)
|
||||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
DEFAULT_IMPL()
|
||||||
|
|
||||||
enum loc_api_adapter_err LocApiBase::
|
enum loc_api_adapter_err LocApiBase::
|
||||||
setXtraData(char* /*data*/, int /*length*/)
|
setXtraData(char* /*data*/, int /*length*/)
|
||||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||||
|
|
||||||
enum loc_api_adapter_err LocApiBase::
|
void LocApiBase::
|
||||||
requestXtraServer()
|
atlOpenStatus(int /*handle*/, int /*is_succ*/, char* /*apn*/, uint32_t /*apnLen*/,
|
||||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
|
||||||
|
|
||||||
enum loc_api_adapter_err LocApiBase::
|
|
||||||
atlOpenStatus(int /*handle*/, int /*is_succ*/, char* /*apn*/,
|
|
||||||
AGpsBearerType /*bear*/, LocAGpsType /*agpsType*/)
|
AGpsBearerType /*bear*/, LocAGpsType /*agpsType*/)
|
||||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
DEFAULT_IMPL()
|
||||||
|
|
||||||
enum loc_api_adapter_err LocApiBase::
|
void LocApiBase::
|
||||||
atlCloseStatus(int /*handle*/, int /*is_succ*/)
|
atlCloseStatus(int /*handle*/, int /*is_succ*/)
|
||||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
DEFAULT_IMPL()
|
||||||
|
|
||||||
enum loc_api_adapter_err LocApiBase::
|
void LocApiBase::
|
||||||
setPositionMode(const LocPosMode& /*posMode*/)
|
setPositionMode(const LocPosMode& /*posMode*/)
|
||||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
DEFAULT_IMPL()
|
||||||
|
|
||||||
LocationError LocApiBase::
|
LocationError LocApiBase::
|
||||||
setServer(const char* /*url*/, int /*len*/)
|
setServerSync(const char* /*url*/, int /*len*/)
|
||||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||||
|
|
||||||
LocationError LocApiBase::
|
LocationError LocApiBase::
|
||||||
setServer(unsigned int /*ip*/, int /*port*/, LocServerType /*type*/)
|
setServerSync(unsigned int /*ip*/, int /*port*/, LocServerType /*type*/)
|
||||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||||
|
|
||||||
LocationError LocApiBase::
|
void LocApiBase::
|
||||||
informNiResponse(GnssNiResponse /*userResponse*/, const void* /*passThroughData*/)
|
informNiResponse(GnssNiResponse /*userResponse*/, const void* /*passThroughData*/)
|
||||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
DEFAULT_IMPL()
|
||||||
|
|
||||||
LocationError LocApiBase::
|
LocationError LocApiBase::
|
||||||
setSUPLVersion(GnssConfigSuplVersion /*version*/)
|
setSUPLVersionSync(GnssConfigSuplVersion /*version*/)
|
||||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||||
|
|
||||||
enum loc_api_adapter_err LocApiBase::
|
enum loc_api_adapter_err LocApiBase::
|
||||||
setNMEATypes (uint32_t /*typesMask*/)
|
setNMEATypesSync (uint32_t /*typesMask*/)
|
||||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||||
|
|
||||||
LocationError LocApiBase::
|
LocationError LocApiBase::
|
||||||
setLPPConfig(GnssConfigLppProfile /*profile*/)
|
setLPPConfigSync(GnssConfigLppProfile /*profile*/)
|
||||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||||
|
|
||||||
enum loc_api_adapter_err LocApiBase::
|
enum loc_api_adapter_err LocApiBase::
|
||||||
setSensorControlConfig(int /*sensorUsage*/,
|
setSensorControlConfigSync(int /*sensorUsage*/,
|
||||||
int /*sensorProvider*/)
|
int /*sensorProvider*/)
|
||||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||||
|
|
||||||
enum loc_api_adapter_err LocApiBase::
|
enum loc_api_adapter_err LocApiBase::
|
||||||
setSensorProperties(bool /*gyroBiasVarianceRandomWalk_valid*/,
|
setSensorPropertiesSync(bool /*gyroBiasVarianceRandomWalk_valid*/,
|
||||||
float /*gyroBiasVarianceRandomWalk*/,
|
float /*gyroBiasVarianceRandomWalk*/,
|
||||||
bool /*accelBiasVarianceRandomWalk_valid*/,
|
bool /*accelBiasVarianceRandomWalk_valid*/,
|
||||||
float /*accelBiasVarianceRandomWalk*/,
|
float /*accelBiasVarianceRandomWalk*/,
|
||||||
|
@ -507,7 +513,7 @@ enum loc_api_adapter_err LocApiBase::
|
||||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||||
|
|
||||||
enum loc_api_adapter_err LocApiBase::
|
enum loc_api_adapter_err LocApiBase::
|
||||||
setSensorPerfControlConfig(int /*controlMode*/,
|
setSensorPerfControlConfigSync(int /*controlMode*/,
|
||||||
int /*accelSamplesPerBatch*/,
|
int /*accelSamplesPerBatch*/,
|
||||||
int /*accelBatchesPerSec*/,
|
int /*accelBatchesPerSec*/,
|
||||||
int /*gyroSamplesPerBatch*/,
|
int /*gyroSamplesPerBatch*/,
|
||||||
|
@ -520,37 +526,36 @@ enum loc_api_adapter_err LocApiBase::
|
||||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||||
|
|
||||||
LocationError LocApiBase::
|
LocationError LocApiBase::
|
||||||
setAGLONASSProtocol(GnssConfigAGlonassPositionProtocolMask /*aGlonassProtocol*/)
|
setAGLONASSProtocolSync(GnssConfigAGlonassPositionProtocolMask /*aGlonassProtocol*/)
|
||||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||||
|
|
||||||
LocationError LocApiBase::
|
LocationError LocApiBase::
|
||||||
setLPPeProtocolCp(GnssConfigLppeControlPlaneMask /*lppeCP*/)
|
setLPPeProtocolCpSync(GnssConfigLppeControlPlaneMask /*lppeCP*/)
|
||||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||||
|
|
||||||
LocationError LocApiBase::
|
LocationError LocApiBase::
|
||||||
setLPPeProtocolUp(GnssConfigLppeUserPlaneMask /*lppeUP*/)
|
setLPPeProtocolUpSync(GnssConfigLppeUserPlaneMask /*lppeUP*/)
|
||||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||||
|
|
||||||
|
GnssConfigSuplVersion LocApiBase::convertSuplVersion(const uint32_t /*suplVersion*/)
|
||||||
|
DEFAULT_IMPL(GNSS_CONFIG_SUPL_VERSION_1_0_0)
|
||||||
|
|
||||||
|
GnssConfigLppProfile LocApiBase::convertLppProfile(const uint32_t /*lppProfile*/)
|
||||||
|
DEFAULT_IMPL(GNSS_CONFIG_LPP_PROFILE_RRLP_ON_LTE)
|
||||||
|
|
||||||
|
GnssConfigLppeControlPlaneMask LocApiBase::convertLppeCp(const uint32_t /*lppeControlPlaneMask*/)
|
||||||
|
DEFAULT_IMPL(0)
|
||||||
|
|
||||||
|
GnssConfigLppeUserPlaneMask LocApiBase::convertLppeUp(const uint32_t /*lppeUserPlaneMask*/)
|
||||||
|
DEFAULT_IMPL(0)
|
||||||
|
|
||||||
enum loc_api_adapter_err LocApiBase::
|
enum loc_api_adapter_err LocApiBase::
|
||||||
getWwanZppFix()
|
getWwanZppFix()
|
||||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||||
|
|
||||||
enum loc_api_adapter_err LocApiBase::
|
void LocApiBase::
|
||||||
getBestAvailableZppFix(LocGpsLocation& zppLoc)
|
getBestAvailableZppFix()
|
||||||
{
|
DEFAULT_IMPL()
|
||||||
memset(&zppLoc, 0, sizeof(zppLoc));
|
|
||||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
|
||||||
}
|
|
||||||
|
|
||||||
enum loc_api_adapter_err LocApiBase::
|
|
||||||
getBestAvailableZppFix(LocGpsLocation & zppLoc, GpsLocationExtended & locationExtended,
|
|
||||||
LocPosTechMask & tech_mask)
|
|
||||||
{
|
|
||||||
memset(&zppLoc, 0, sizeof(zppLoc));
|
|
||||||
memset(&tech_mask, 0, sizeof(tech_mask));
|
|
||||||
memset(&locationExtended, 0, sizeof (locationExtended));
|
|
||||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
|
||||||
}
|
|
||||||
|
|
||||||
int LocApiBase::
|
int LocApiBase::
|
||||||
initDataServiceClient(bool /*isDueToSsr*/)
|
initDataServiceClient(bool /*isDueToSsr*/)
|
||||||
|
@ -573,7 +578,7 @@ void LocApiBase::
|
||||||
DEFAULT_IMPL()
|
DEFAULT_IMPL()
|
||||||
|
|
||||||
LocationError LocApiBase::
|
LocationError LocApiBase::
|
||||||
setGpsLock(GnssConfigGpsLock /*lock*/)
|
setGpsLockSync(GnssConfigGpsLock /*lock*/)
|
||||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||||
|
|
||||||
void LocApiBase::
|
void LocApiBase::
|
||||||
|
@ -587,21 +592,7 @@ int LocApiBase::
|
||||||
DEFAULT_IMPL(-1)
|
DEFAULT_IMPL(-1)
|
||||||
|
|
||||||
LocationError LocApiBase::
|
LocationError LocApiBase::
|
||||||
setXtraVersionCheck(uint32_t /*check*/)
|
setXtraVersionCheckSync(uint32_t /*check*/)
|
||||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||||
|
|
||||||
bool LocApiBase::
|
|
||||||
gnssConstellationConfig()
|
|
||||||
DEFAULT_IMPL(false)
|
|
||||||
|
|
||||||
bool LocApiBase::
|
|
||||||
isFeatureSupported(uint8_t featureVal)
|
|
||||||
{
|
|
||||||
uint8_t arrayIndex = featureVal >> 3;
|
|
||||||
uint8_t bitPos = featureVal & 7;
|
|
||||||
|
|
||||||
if (arrayIndex >= MAX_FEATURE_LENGTH) return false;
|
|
||||||
return ((mFeaturesSupported[arrayIndex] >> bitPos ) & 0x1);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace loc_core
|
} // namespace loc_core
|
||||||
|
|
|
@ -37,7 +37,9 @@
|
||||||
#include <log_util.h>
|
#include <log_util.h>
|
||||||
|
|
||||||
namespace loc_core {
|
namespace loc_core {
|
||||||
|
|
||||||
class ContextBase;
|
class ContextBase;
|
||||||
|
struct LocApiResponse;
|
||||||
|
|
||||||
int hexcode(char *hexstring, int string_size,
|
int hexcode(char *hexstring, int string_size,
|
||||||
const char *data, int data_size);
|
const char *data, int data_size);
|
||||||
|
@ -66,6 +68,28 @@ class LocAdapterBase;
|
||||||
struct LocSsrMsg;
|
struct LocSsrMsg;
|
||||||
struct LocOpenMsg;
|
struct LocOpenMsg;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint32_t accumulatedDistance;
|
||||||
|
uint32_t numOfBatchedPositions;
|
||||||
|
} LocApiBatchData;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint32_t hwId;
|
||||||
|
} LocApiGeofenceData;
|
||||||
|
|
||||||
|
struct LocApiMsg: LocMsg {
|
||||||
|
private:
|
||||||
|
std::function<void ()> mProcImpl;
|
||||||
|
inline virtual void proc() const {
|
||||||
|
mProcImpl();
|
||||||
|
}
|
||||||
|
public:
|
||||||
|
inline LocApiMsg(std::function<void ()> procImpl ) :
|
||||||
|
mProcImpl(procImpl) {}
|
||||||
|
};
|
||||||
|
|
||||||
class LocApiProxyBase {
|
class LocApiProxyBase {
|
||||||
public:
|
public:
|
||||||
inline LocApiProxyBase() {}
|
inline LocApiProxyBase() {}
|
||||||
|
@ -78,22 +102,21 @@ class LocApiBase {
|
||||||
//LocOpenMsg calls open() which makes it necessary to declare
|
//LocOpenMsg calls open() which makes it necessary to declare
|
||||||
//it as a friend
|
//it as a friend
|
||||||
friend struct LocOpenMsg;
|
friend struct LocOpenMsg;
|
||||||
|
friend struct LocCloseMsg;
|
||||||
friend class ContextBase;
|
friend class ContextBase;
|
||||||
const MsgTask* mMsgTask;
|
static MsgTask* mMsgTask;
|
||||||
ContextBase *mContext;
|
|
||||||
LocAdapterBase* mLocAdapters[MAX_ADAPTERS];
|
LocAdapterBase* mLocAdapters[MAX_ADAPTERS];
|
||||||
uint64_t mSupportedMsg;
|
|
||||||
uint8_t mFeaturesSupported[MAX_FEATURE_LENGTH];
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
ContextBase *mContext;
|
||||||
virtual enum loc_api_adapter_err
|
virtual enum loc_api_adapter_err
|
||||||
open(LOC_API_ADAPTER_EVENT_MASK_T mask);
|
open(LOC_API_ADAPTER_EVENT_MASK_T mask);
|
||||||
virtual enum loc_api_adapter_err
|
virtual enum loc_api_adapter_err
|
||||||
close();
|
close();
|
||||||
LOC_API_ADAPTER_EVENT_MASK_T getEvtMask();
|
LOC_API_ADAPTER_EVENT_MASK_T getEvtMask();
|
||||||
LOC_API_ADAPTER_EVENT_MASK_T mMask;
|
LOC_API_ADAPTER_EVENT_MASK_T mMask;
|
||||||
LocApiBase(const MsgTask* msgTask,
|
LocApiBase(LOC_API_ADAPTER_EVENT_MASK_T excludedMask,
|
||||||
LOC_API_ADAPTER_EVENT_MASK_T excludedMask,
|
|
||||||
ContextBase* context = NULL);
|
ContextBase* context = NULL);
|
||||||
inline virtual ~LocApiBase() { close(); }
|
inline virtual ~LocApiBase() { close(); }
|
||||||
bool isInSession();
|
bool isInSession();
|
||||||
|
@ -130,10 +153,10 @@ public:
|
||||||
void reportDataCallOpened();
|
void reportDataCallOpened();
|
||||||
void reportDataCallClosed();
|
void reportDataCallClosed();
|
||||||
void requestNiNotify(GnssNiNotification ¬ify, const void* data);
|
void requestNiNotify(GnssNiNotification ¬ify, const void* data);
|
||||||
void saveSupportedMsgList(uint64_t supportedMsgList);
|
|
||||||
void reportGnssMeasurementData(GnssMeasurementsNotification& measurements, int msInWeek);
|
void reportGnssMeasurementData(GnssMeasurementsNotification& measurements, int msInWeek);
|
||||||
void saveSupportedFeatureList(uint8_t *featureList);
|
|
||||||
void reportWwanZppFix(LocGpsLocation &zppLoc);
|
void reportWwanZppFix(LocGpsLocation &zppLoc);
|
||||||
|
void reportZppBestAvailableFix(LocGpsLocation &zppLoc, GpsLocationExtended &location_extended,
|
||||||
|
LocPosTechMask tech_mask);
|
||||||
|
|
||||||
// downward calls
|
// downward calls
|
||||||
// All below functions are to be defined by adapter specific modules:
|
// All below functions are to be defined by adapter specific modules:
|
||||||
|
@ -141,45 +164,43 @@ public:
|
||||||
|
|
||||||
virtual void* getSibling();
|
virtual void* getSibling();
|
||||||
virtual LocApiProxyBase* getLocApiProxy();
|
virtual LocApiProxyBase* getLocApiProxy();
|
||||||
virtual enum loc_api_adapter_err
|
virtual void startFix(const LocPosMode& fixCriteria, LocApiResponse* adapterResponse);
|
||||||
startFix(const LocPosMode& posMode);
|
virtual void
|
||||||
virtual enum loc_api_adapter_err
|
stopFix(LocApiResponse* adapterResponse);
|
||||||
stopFix();
|
virtual void
|
||||||
virtual LocationError
|
deleteAidingData(const GnssAidingData& data, LocApiResponse* adapterResponse);
|
||||||
deleteAidingData(const GnssAidingData& data);
|
|
||||||
virtual enum loc_api_adapter_err
|
virtual void
|
||||||
enableData(int enable);
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
setAPN(char* apn, int len);
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
injectPosition(double latitude, double longitude, float accuracy);
|
injectPosition(double latitude, double longitude, float accuracy);
|
||||||
virtual enum loc_api_adapter_err
|
virtual void
|
||||||
setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty);
|
setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty);
|
||||||
|
|
||||||
|
// // TODO:: called from izatapipds
|
||||||
virtual enum loc_api_adapter_err
|
virtual enum loc_api_adapter_err
|
||||||
setXtraData(char* data, int length);
|
setXtraData(char* data, int length);
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
requestXtraServer();
|
virtual void
|
||||||
virtual enum loc_api_adapter_err
|
atlOpenStatus(int handle, int is_succ, char* apn, uint32_t apnLen,
|
||||||
atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, LocAGpsType agpsType);
|
AGpsBearerType bear, LocAGpsType agpsType);
|
||||||
virtual enum loc_api_adapter_err
|
virtual void
|
||||||
atlCloseStatus(int handle, int is_succ);
|
atlCloseStatus(int handle, int is_succ);
|
||||||
virtual enum loc_api_adapter_err
|
virtual void
|
||||||
setPositionMode(const LocPosMode& posMode);
|
setPositionMode(const LocPosMode& posMode);
|
||||||
virtual LocationError
|
virtual LocationError
|
||||||
setServer(const char* url, int len);
|
setServerSync(const char* url, int len);
|
||||||
virtual LocationError
|
virtual LocationError
|
||||||
setServer(unsigned int ip, int port,
|
setServerSync(unsigned int ip, int port,
|
||||||
LocServerType type);
|
LocServerType type);
|
||||||
virtual LocationError
|
virtual void
|
||||||
informNiResponse(GnssNiResponse userResponse, const void* passThroughData);
|
informNiResponse(GnssNiResponse userResponse, const void* passThroughData);
|
||||||
virtual LocationError setSUPLVersion(GnssConfigSuplVersion version);
|
virtual LocationError setSUPLVersionSync(GnssConfigSuplVersion version);
|
||||||
virtual enum loc_api_adapter_err
|
virtual enum loc_api_adapter_err
|
||||||
setNMEATypes (uint32_t typesMask);
|
setNMEATypesSync(uint32_t typesMask);
|
||||||
virtual LocationError setLPPConfig(GnssConfigLppProfile profile);
|
virtual LocationError setLPPConfigSync(GnssConfigLppProfile profile);
|
||||||
virtual enum loc_api_adapter_err
|
virtual enum loc_api_adapter_err
|
||||||
setSensorControlConfig(int sensorUsage, int sensorProvider);
|
setSensorControlConfigSync(int sensorUsage, int sensorProvider);
|
||||||
virtual enum loc_api_adapter_err
|
virtual enum loc_api_adapter_err
|
||||||
setSensorProperties(bool gyroBiasVarianceRandomWalk_valid,
|
setSensorPropertiesSync(bool gyroBiasVarianceRandomWalk_valid,
|
||||||
float gyroBiasVarianceRandomWalk,
|
float gyroBiasVarianceRandomWalk,
|
||||||
bool accelBiasVarianceRandomWalk_valid,
|
bool accelBiasVarianceRandomWalk_valid,
|
||||||
float accelBiasVarianceRandomWalk,
|
float accelBiasVarianceRandomWalk,
|
||||||
|
@ -190,7 +211,7 @@ public:
|
||||||
bool velocityBiasVarianceRandomWalk_valid,
|
bool velocityBiasVarianceRandomWalk_valid,
|
||||||
float velocityBiasVarianceRandomWalk);
|
float velocityBiasVarianceRandomWalk);
|
||||||
virtual enum loc_api_adapter_err
|
virtual enum loc_api_adapter_err
|
||||||
setSensorPerfControlConfig(int controlMode,
|
setSensorPerfControlConfigSync(int controlMode,
|
||||||
int accelSamplesPerBatch,
|
int accelSamplesPerBatch,
|
||||||
int accelBatchesPerSec,
|
int accelBatchesPerSec,
|
||||||
int gyroSamplesPerBatch,
|
int gyroSamplesPerBatch,
|
||||||
|
@ -201,16 +222,18 @@ public:
|
||||||
int gyroBatchesPerSecHigh,
|
int gyroBatchesPerSecHigh,
|
||||||
int algorithmConfig);
|
int algorithmConfig);
|
||||||
virtual LocationError
|
virtual LocationError
|
||||||
setAGLONASSProtocol(GnssConfigAGlonassPositionProtocolMask aGlonassProtocol);
|
setAGLONASSProtocolSync(GnssConfigAGlonassPositionProtocolMask aGlonassProtocol);
|
||||||
virtual LocationError setLPPeProtocolCp(GnssConfigLppeControlPlaneMask lppeCP);
|
virtual LocationError setLPPeProtocolCpSync(GnssConfigLppeControlPlaneMask lppeCP);
|
||||||
virtual LocationError setLPPeProtocolUp(GnssConfigLppeUserPlaneMask lppeUP);
|
virtual LocationError setLPPeProtocolUpSync(GnssConfigLppeUserPlaneMask lppeUP);
|
||||||
|
virtual GnssConfigSuplVersion convertSuplVersion(const uint32_t suplVersion);
|
||||||
|
virtual GnssConfigLppProfile convertLppProfile(const uint32_t lppProfile);
|
||||||
|
virtual GnssConfigLppeControlPlaneMask convertLppeCp(const uint32_t lppeControlPlaneMask);
|
||||||
|
virtual GnssConfigLppeUserPlaneMask convertLppeUp(const uint32_t lppeUserPlaneMask);
|
||||||
|
|
||||||
virtual enum loc_api_adapter_err
|
virtual enum loc_api_adapter_err
|
||||||
getWwanZppFix();
|
getWwanZppFix();
|
||||||
virtual enum loc_api_adapter_err
|
virtual void
|
||||||
getBestAvailableZppFix(LocGpsLocation & zppLoc);
|
getBestAvailableZppFix();
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
getBestAvailableZppFix(LocGpsLocation & zppLoc, GpsLocationExtended & locationExtended,
|
|
||||||
LocPosTechMask & tech_mask);
|
|
||||||
virtual int initDataServiceClient(bool isDueToSsr);
|
virtual int initDataServiceClient(bool isDueToSsr);
|
||||||
virtual int openAndStartDataCall();
|
virtual int openAndStartDataCall();
|
||||||
virtual void stopDataCall();
|
virtual void stopDataCall();
|
||||||
|
@ -223,21 +246,11 @@ public:
|
||||||
|
|
||||||
(void)inSession;
|
(void)inSession;
|
||||||
}
|
}
|
||||||
inline bool isMessageSupported (LocCheckingMessagesID msgID) const {
|
|
||||||
|
|
||||||
// confirm if msgID is not larger than the number of bits in
|
|
||||||
// mSupportedMsg
|
|
||||||
if ((uint64_t)msgID > (sizeof(mSupportedMsg) << 3)) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
uint32_t messageChecker = 1 << msgID;
|
|
||||||
return (messageChecker & mSupportedMsg) == messageChecker;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void updateEvtMask();
|
void updateEvtMask();
|
||||||
|
|
||||||
virtual LocationError setGpsLock(GnssConfigGpsLock lock);
|
virtual LocationError setGpsLockSync(GnssConfigGpsLock lock);
|
||||||
/*
|
/*
|
||||||
Returns
|
Returns
|
||||||
Current value of GPS Lock on success
|
Current value of GPS Lock on success
|
||||||
|
@ -245,20 +258,11 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual int getGpsLock(void);
|
virtual int getGpsLock(void);
|
||||||
|
|
||||||
virtual LocationError setXtraVersionCheck(uint32_t check);
|
virtual LocationError setXtraVersionCheckSync(uint32_t check);
|
||||||
/*
|
|
||||||
Check if the modem support the service
|
|
||||||
*/
|
|
||||||
virtual bool gnssConstellationConfig();
|
|
||||||
|
|
||||||
/*
|
|
||||||
Check if a feature is supported
|
|
||||||
*/
|
|
||||||
bool isFeatureSupported(uint8_t featureVal);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef LocApiBase* (getLocApi_t)(const MsgTask* msgTask,
|
typedef LocApiBase* (getLocApi_t)(LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
||||||
LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
|
||||||
ContextBase *context);
|
ContextBase *context);
|
||||||
|
|
||||||
} // namespace loc_core
|
} // namespace loc_core
|
||||||
|
|
|
@ -360,13 +360,13 @@ void AgpsStateMachine::notifyEventToSubscriber(
|
||||||
|
|
||||||
case AGPS_EVENT_GRANTED:
|
case AGPS_EVENT_GRANTED:
|
||||||
mAgpsManager->mAtlOpenStatusCb(
|
mAgpsManager->mAtlOpenStatusCb(
|
||||||
subscriberToNotify->mConnHandle, 1, getAPN(),
|
subscriberToNotify->mConnHandle, 1, getAPN(), getAPNLen(),
|
||||||
getBearer(), mAgpsType);
|
getBearer(), mAgpsType);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AGPS_EVENT_DENIED:
|
case AGPS_EVENT_DENIED:
|
||||||
mAgpsManager->mAtlOpenStatusCb(
|
mAgpsManager->mAtlOpenStatusCb(
|
||||||
subscriberToNotify->mConnHandle, 0, getAPN(),
|
subscriberToNotify->mConnHandle, 0, getAPN(), getAPNLen(),
|
||||||
getBearer(), mAgpsType);
|
getBearer(), mAgpsType);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -661,7 +661,7 @@ void DSStateMachine::notifyEventToSubscriber(
|
||||||
|
|
||||||
case AGPS_EVENT_GRANTED:
|
case AGPS_EVENT_GRANTED:
|
||||||
mAgpsManager->mAtlOpenStatusCb(
|
mAgpsManager->mAtlOpenStatusCb(
|
||||||
subscriberToNotify->mConnHandle, 1, NULL,
|
subscriberToNotify->mConnHandle, 1, NULL, 0,
|
||||||
AGPS_APN_BEARER_INVALID, LOC_AGPS_TYPE_SUPL_ES);
|
AGPS_APN_BEARER_INVALID, LOC_AGPS_TYPE_SUPL_ES);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -778,7 +778,7 @@ void AgpsManager::requestATL(int connHandle, AGpsExtType agpsType){
|
||||||
|
|
||||||
LOC_LOGE("No AGPS State Machine for agpsType: %d", agpsType);
|
LOC_LOGE("No AGPS State Machine for agpsType: %d", agpsType);
|
||||||
mAtlOpenStatusCb(
|
mAtlOpenStatusCb(
|
||||||
connHandle, 0, NULL, AGPS_APN_BEARER_INVALID, agpsType);
|
connHandle, 0, NULL, 0, AGPS_APN_BEARER_INVALID, agpsType);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
/* ATL callback function pointers
|
/* ATL callback function pointers
|
||||||
* Passed in by Adapter to AgpsManager */
|
* Passed in by Adapter to AgpsManager */
|
||||||
typedef std::function<void(
|
typedef std::function<void(
|
||||||
int handle, int isSuccess, char* apn,
|
int handle, int isSuccess, char* apn, uint32_t apnLen,
|
||||||
AGpsBearerType bearerType, AGpsExtType agpsType)> AgpsAtlOpenStatusCb;
|
AGpsBearerType bearerType, AGpsExtType agpsType)> AgpsAtlOpenStatusCb;
|
||||||
|
|
||||||
typedef std::function<void(int handle, int isSuccess)> AgpsAtlCloseStatusCb;
|
typedef std::function<void(int handle, int isSuccess)> AgpsAtlCloseStatusCb;
|
||||||
|
@ -169,6 +169,7 @@ public:
|
||||||
/* Getter/Setter methods */
|
/* Getter/Setter methods */
|
||||||
void setAPN(char* apn, unsigned int len);
|
void setAPN(char* apn, unsigned int len);
|
||||||
inline char* getAPN() const { return (char*)mAPN; }
|
inline char* getAPN() const { return (char*)mAPN; }
|
||||||
|
inline uint32_t getAPNLen() const { return mAPNLen; }
|
||||||
inline void setBearer(AGpsBearerType bearer) { mBearer = bearer; }
|
inline void setBearer(AGpsBearerType bearer) { mBearer = bearer; }
|
||||||
inline AGpsBearerType getBearer() const { return mBearer; }
|
inline AGpsBearerType getBearer() const { return mBearer; }
|
||||||
inline AGpsExtType getType() const { return mAgpsType; }
|
inline AGpsExtType getType() const { return mAgpsType; }
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -157,7 +157,7 @@ public:
|
||||||
LocationCallbacks getClientCallbacks(LocationAPI* client);
|
LocationCallbacks getClientCallbacks(LocationAPI* client);
|
||||||
LocationCapabilitiesMask getCapabilities();
|
LocationCapabilitiesMask getCapabilities();
|
||||||
void broadcastCapabilities(LocationCapabilitiesMask);
|
void broadcastCapabilities(LocationCapabilitiesMask);
|
||||||
LocationError setSuplHostServer(const char* server, int port);
|
void setSuplHostServer(const char* server, int port);
|
||||||
|
|
||||||
/* ==== TRACKING ======================================================================= */
|
/* ==== TRACKING ======================================================================= */
|
||||||
/* ======== COMMANDS ====(Called from Client Thread)==================================== */
|
/* ======== COMMANDS ====(Called from Client Thread)==================================== */
|
||||||
|
@ -180,12 +180,16 @@ public:
|
||||||
void eraseTrackingSession(LocationAPI* client, uint32_t sessionId);
|
void eraseTrackingSession(LocationAPI* client, uint32_t sessionId);
|
||||||
bool setUlpPositionMode(const LocPosMode& mode);
|
bool setUlpPositionMode(const LocPosMode& mode);
|
||||||
LocPosMode& getUlpPositionMode() { return mUlpPositionMode; }
|
LocPosMode& getUlpPositionMode() { return mUlpPositionMode; }
|
||||||
LocationError startTrackingMultiplex(const LocationOptions& options);
|
bool startTrackingMultiplex(LocationAPI* client, uint32_t sessionId,
|
||||||
LocationError startTracking(const LocationOptions& options);
|
const LocationOptions& options);
|
||||||
LocationError stopTrackingMultiplex(LocationAPI* client, uint32_t id);
|
bool startTracking(LocationAPI* client, uint32_t sessionId,
|
||||||
LocationError stopTracking();
|
const LocationOptions& options);
|
||||||
LocationError updateTrackingMultiplex(LocationAPI* client, uint32_t id,
|
bool stopTrackingMultiplex(LocationAPI* client, uint32_t id);
|
||||||
|
bool stopTracking(LocationAPI* client, uint32_t id);
|
||||||
|
bool updateTrackingMultiplex(LocationAPI* client, uint32_t id,
|
||||||
const LocationOptions& options);
|
const LocationOptions& options);
|
||||||
|
bool updateTracking(LocationAPI* client, uint32_t sessionId,
|
||||||
|
const LocationOptions& updatedOptions, const LocationOptions& oldOptions);
|
||||||
|
|
||||||
/* ==== NI ============================================================================= */
|
/* ==== NI ============================================================================= */
|
||||||
/* ======== COMMANDS ====(Called from Client Thread)==================================== */
|
/* ======== COMMANDS ====(Called from Client Thread)==================================== */
|
||||||
|
@ -203,9 +207,11 @@ public:
|
||||||
void setControlCallbacksCommand(LocationControlCallbacks& controlCallbacks);
|
void setControlCallbacksCommand(LocationControlCallbacks& controlCallbacks);
|
||||||
void readConfigCommand();
|
void readConfigCommand();
|
||||||
void setConfigCommand();
|
void setConfigCommand();
|
||||||
|
void requestUlpCommand();
|
||||||
void initEngHubProxyCommand();
|
void initEngHubProxyCommand();
|
||||||
uint32_t* gnssUpdateConfigCommand(GnssConfig config);
|
uint32_t* gnssUpdateConfigCommand(GnssConfig config);
|
||||||
uint32_t gnssDeleteAidingDataCommand(GnssAidingData& data);
|
uint32_t gnssDeleteAidingDataCommand(GnssAidingData& data);
|
||||||
|
void deleteAidingData(const GnssAidingData &data, uint32_t sessionId);
|
||||||
void gnssUpdateXtraThrottleCommand(const bool enabled);
|
void gnssUpdateXtraThrottleCommand(const bool enabled);
|
||||||
|
|
||||||
void initDefaultAgpsCommand();
|
void initDefaultAgpsCommand();
|
||||||
|
@ -224,7 +230,6 @@ public:
|
||||||
{ mControlCallbacks = controlCallbacks; }
|
{ mControlCallbacks = controlCallbacks; }
|
||||||
void setPowerVoteId(uint32_t id) { mPowerVoteId = id; }
|
void setPowerVoteId(uint32_t id) { mPowerVoteId = id; }
|
||||||
uint32_t getPowerVoteId() { return mPowerVoteId; }
|
uint32_t getPowerVoteId() { return mPowerVoteId; }
|
||||||
bool resolveInAddress(const char* hostAddress, struct in_addr* inAddress);
|
|
||||||
virtual bool isInSession() { return !mTrackingSessions.empty(); }
|
virtual bool isInSession() { return !mTrackingSessions.empty(); }
|
||||||
void initDefaultAgps();
|
void initDefaultAgps();
|
||||||
bool initEngHubProxy();
|
bool initEngHubProxy();
|
||||||
|
@ -252,6 +257,8 @@ public:
|
||||||
virtual bool requestSuplES(int connHandle);
|
virtual bool requestSuplES(int connHandle);
|
||||||
virtual bool reportDataCallOpened();
|
virtual bool reportDataCallOpened();
|
||||||
virtual bool reportDataCallClosed();
|
virtual bool reportDataCallClosed();
|
||||||
|
virtual bool reportZppBestAvailableFix(LocGpsLocation &zppLoc,
|
||||||
|
GpsLocationExtended &location_extended, LocPosTechMask tech_mask);
|
||||||
|
|
||||||
/* ======== UTILITIES ================================================================= */
|
/* ======== UTILITIES ================================================================= */
|
||||||
bool needReport(const UlpLocation& ulpLocation,
|
bool needReport(const UlpLocation& ulpLocation,
|
||||||
|
@ -279,15 +286,11 @@ public:
|
||||||
static uint32_t convertGpsLock(const GnssConfigGpsLock gpsLock);
|
static uint32_t convertGpsLock(const GnssConfigGpsLock gpsLock);
|
||||||
static GnssConfigGpsLock convertGpsLock(const uint32_t gpsLock);
|
static GnssConfigGpsLock convertGpsLock(const uint32_t gpsLock);
|
||||||
static uint32_t convertSuplVersion(const GnssConfigSuplVersion suplVersion);
|
static uint32_t convertSuplVersion(const GnssConfigSuplVersion suplVersion);
|
||||||
static GnssConfigSuplVersion convertSuplVersion(const uint32_t suplVersion);
|
|
||||||
static uint32_t convertLppProfile(const GnssConfigLppProfile lppProfile);
|
static uint32_t convertLppProfile(const GnssConfigLppProfile lppProfile);
|
||||||
static GnssConfigLppProfile convertLppProfile(const uint32_t lppProfile);
|
|
||||||
static uint32_t convertEP4ES(const GnssConfigEmergencyPdnForEmergencySupl);
|
static uint32_t convertEP4ES(const GnssConfigEmergencyPdnForEmergencySupl);
|
||||||
static uint32_t convertSuplEs(const GnssConfigSuplEmergencyServices suplEmergencyServices);
|
static uint32_t convertSuplEs(const GnssConfigSuplEmergencyServices suplEmergencyServices);
|
||||||
static uint32_t convertLppeCp(const GnssConfigLppeControlPlaneMask lppeControlPlaneMask);
|
static uint32_t convertLppeCp(const GnssConfigLppeControlPlaneMask lppeControlPlaneMask);
|
||||||
static GnssConfigLppeControlPlaneMask convertLppeCp(const uint32_t lppeControlPlaneMask);
|
|
||||||
static uint32_t convertLppeUp(const GnssConfigLppeUserPlaneMask lppeUserPlaneMask);
|
static uint32_t convertLppeUp(const GnssConfigLppeUserPlaneMask lppeUserPlaneMask);
|
||||||
static GnssConfigLppeUserPlaneMask convertLppeUp(const uint32_t lppeUserPlaneMask);
|
|
||||||
static uint32_t convertAGloProt(const GnssConfigAGlonassPositionProtocolMask);
|
static uint32_t convertAGloProt(const GnssConfigAGlonassPositionProtocolMask);
|
||||||
static uint32_t convertSuplMode(const GnssConfigSuplModeMask suplModeMask);
|
static uint32_t convertSuplMode(const GnssConfigSuplModeMask suplModeMask);
|
||||||
static void convertSatelliteInfo(std::vector<GnssDebugSatelliteInfo>& out,
|
static void convertSatelliteInfo(std::vector<GnssDebugSatelliteInfo>& out,
|
||||||
|
|
|
@ -7,7 +7,7 @@ AM_CFLAGS = \
|
||||||
-I../utils \
|
-I../utils \
|
||||||
-I$(WORKSPACE)/hardware/qcom/gps/core/data-items \
|
-I$(WORKSPACE)/hardware/qcom/gps/core/data-items \
|
||||||
-I../location \
|
-I../location \
|
||||||
-std=c++11
|
-std=c++1y
|
||||||
|
|
||||||
libgnss_la_SOURCES = \
|
libgnss_la_SOURCES = \
|
||||||
location_gnss.cpp \
|
location_gnss.cpp \
|
||||||
|
|
Loading…
Reference in a new issue