summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqctecmdr <qctecmdr@localhost>2019-09-05 08:58:19 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2019-09-05 08:58:19 -0700
commit095e7d6e965239c8f24a3a620fcc5ea1faf8340c (patch)
treeb1b7319657b2bf881ee2f980df4b9ab1f9fec94c
parent715d9e7af4bc20b265c94fb65824326273a2e5d8 (diff)
parent42e8ab01901a627bef050179be7dbb725abd5787 (diff)
downloadgps-095e7d6e965239c8f24a3a620fcc5ea1faf8340c.tar.gz
Merge "Add GNSS Deployment Support."
-rw-r--r--core/ContextBase.cpp26
-rw-r--r--core/ContextBase.h1
-rw-r--r--etc/gps.conf10
3 files changed, 32 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
diff --git a/etc/gps.conf b/etc/gps.conf
index f773e81..c247cbd 100644
--- a/etc/gps.conf
+++ b/etc/gps.conf
@@ -287,3 +287,13 @@ PROXY_APP_PACKAGE_NAME = com.google.android.carrierlocation
#####################################
# CP MTLR ES, 1=enable, 0=disable
CP_MTLR_ES=0
+
+##################################################
+# GNSS_DEPLOYMENT
+##################################################
+# 0 : Enable QCOM GNSS (default)
+# 1 : Enable QCSR SS5
+# This setting use to select between QCOM GNSS
+# and QCSR SS5 hardware receiver.
+# By default QCOM GNSS receiver is enabled.
+# GNSS_DEPLOYMENT = 0