summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorSantoshkumar Zalake <szalake@codeaurora.org>2019-06-07 13:55:19 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2019-08-30 02:54:05 -0700
commit42e8ab01901a627bef050179be7dbb725abd5787 (patch)
tree23de42cad6df52739dbd33ac579e8e9f6ebbbff3 /core
parent93db35b82539baf5c2b80bc8314cf79070dcbc22 (diff)
downloadgps-42e8ab01901a627bef050179be7dbb725abd5787.tar.gz
Add GNSS Deployment Support.
The GNSS Deployment is used to configure GNSS Hardware using gps.conf file CRs-Fixed: 2480150 Change-Id: Ia09d3165de0c2f80f23bef8c0431095b25d16ea2
Diffstat (limited to 'core')
-rw-r--r--core/ContextBase.cpp26
-rw-r--r--core/ContextBase.h1
2 files changed, 22 insertions, 5 deletions
diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp
index 084b6bf..b602989 100644
--- a/core/ContextBase.cpp
+++ b/core/ContextBase.cpp
@@ -40,6 +40,10 @@
namespace loc_core {
+#define SLL_LOC_API_LIB_NAME "libsynergy_loc_api.so"
+#define LOC_APIV2_0_LIB_NAME "libloc_api_v02.so"
+#define IS_SS5_HW_ENABLED 1
+
loc_gps_cfg_s_type ContextBase::mGps_conf {};
loc_sap_cfg_s_type ContextBase::mSap_conf {};
bool ContextBase::sIsEngineCapabilitiesKnown = false;
@@ -80,6 +84,7 @@ const loc_param_s_type ContextBase::mGps_conf_table[] =
{"POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED", &mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED, NULL, 'n'},
{"PROXY_APP_PACKAGE_NAME", &mGps_conf.PROXY_APP_PACKAGE_NAME, NULL, 's' },
{"CP_MTLR_ES", &mGps_conf.CP_MTLR_ES, NULL, 'n' },
+ {"GNSS_DEPLOYMENT", &mGps_conf.GNSS_DEPLOYMENT, NULL, 'n'},
};
const loc_param_s_type ContextBase::mSap_conf_table[] =
@@ -171,10 +176,16 @@ void ContextBase::readConfig()
mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET = 0;
/* default configuration value of position assisted clock estimator mode */
mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED = 0;
+ /* default configuration QCOM GNSS H/W */
+ mGps_conf.GNSS_DEPLOYMENT = 0;
UTIL_READ_CONF(LOC_PATH_GPS_CONF, mGps_conf_table);
UTIL_READ_CONF(LOC_PATH_SAP_CONF, mSap_conf_table);
+ LOC_LOGI("%s] GNSS Deployment: %s", __FUNCTION__,
+ ((mGps_conf.GNSS_DEPLOYMENT == 1) ? "SS5" :
+ ((mGps_conf.GNSS_DEPLOYMENT == 2) ? "QFUSION" : "QGNSS")));
+
switch (getTargetGnssType(loc_get_target())) {
case GNSS_GSS:
case GNSS_AUTO:
@@ -231,19 +242,24 @@ LBSProxyBase* ContextBase::getLBSProxy(const char* libName)
LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask)
{
LocApiBase* locApi = NULL;
+ const char* libname = LOC_APIV2_0_LIB_NAME;
// Check the target
if (TARGET_NO_GNSS != loc_get_target()){
if (NULL == (locApi = mLBSProxy->getLocApi(exMask, this))) {
void *handle = NULL;
- //try to see if LocApiV02 is present
- if ((handle = dlopen("libloc_api_v02.so", RTLD_NOW)) != NULL) {
- LOC_LOGD("%s:%d]: libloc_api_v02.so is present", __func__, __LINE__);
+
+ if (IS_SS5_HW_ENABLED == mGps_conf.GNSS_DEPLOYMENT) {
+ libname = SLL_LOC_API_LIB_NAME;
+ }
+
+ if ((handle = dlopen(libname, RTLD_NOW)) != NULL) {
+ LOC_LOGD("%s:%d]: %s is present", __func__, __LINE__, libname);
getLocApi_t* getter = (getLocApi_t*) dlsym(handle, "getLocApi");
if (getter != NULL) {
- LOC_LOGD("%s:%d]: getter is not NULL for LocApiV02", __func__,
- __LINE__);
+ LOC_LOGD("%s:%d]: getter is not NULL of %s", __func__,
+ __LINE__, libname);
locApi = (*getter)(exMask, this);
}
}
diff --git a/core/ContextBase.h b/core/ContextBase.h
index ab61a08..5da76e2 100644
--- a/core/ContextBase.h
+++ b/core/ContextBase.h
@@ -73,6 +73,7 @@ typedef struct loc_gps_cfg_s
uint32_t POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED;
char PROXY_APP_PACKAGE_NAME[LOC_MAX_PARAM_STRING];
uint32_t CP_MTLR_ES;
+ uint32_t GNSS_DEPLOYMENT;
} loc_gps_cfg_s_type;
/* NOTE: the implementaiton of the parser casts number