diff --git a/core/ContextBase.h b/core/ContextBase.h index 4f7ac394..debdc11e 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -59,6 +59,7 @@ typedef struct loc_gps_cfg_s uint32_t GPS_LOCK; uint32_t A_GLONASS_POS_PROTOCOL_SELECT; uint32_t AGPS_CERT_WRITABLE_MASK; + uint32_t AGPS_CONFIG_INJECT; uint32_t LPPE_CP_TECHNOLOGY; uint32_t LPPE_UP_TECHNOLOGY; } loc_gps_cfg_s_type; diff --git a/etc/gps.conf b/etc/gps.conf index 01188132..d1781c81 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -123,3 +123,18 @@ LPPE_CP_TECHNOLOGY = 0 # 0x1: DBH for LPPe UP # 0x2: WLAN AP Measurements for LPPe UP LPPE_UP_TECHNOLOGY = 0 + +################################################## +# AGPS_CONFIG_INJECT +################################################## +# enable/disable injection of AGPS configurations: +# SUPL_VER +# SUPL_HOST +# SUPL_PORT +# C2K_HOST +# C2K_PORT +# LPP_PROFILE +# A_GLONASS_POS_PROTOCOL_SELECT +# 0: disable +# 1: enable +AGPS_CONFIG_INJECT = 1 diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 4aaee18e..ea08d8dd 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -100,6 +100,7 @@ static const loc_param_s_type gps_conf_table[] = {"XTRA_SERVER_2", &gps_conf.XTRA_SERVER_2, NULL, 's'}, {"XTRA_SERVER_3", &gps_conf.XTRA_SERVER_3, NULL, 's'}, {"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL", &gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, NULL, 'n'}, + {"AGPS_CONFIG_INJECT", &gps_conf.AGPS_CONFIG_INJECT, NULL, 'n'}, }; static const loc_param_s_type sap_conf_table[] = @@ -176,6 +177,9 @@ static void loc_default_parameters(void) /* None of the 10 slots for agps certificates are writable by default */ gps_conf.AGPS_CERT_WRITABLE_MASK = 0; + + /* inject supl config to modem with config values from config.xml or gps.conf, default 1 */ + gps_conf.AGPS_CONFIG_INJECT = 1; } // 2nd half of init(), singled out for @@ -403,7 +407,9 @@ struct LocEngSetServerIpv4 : public LocMsg { locallog(); } inline virtual void proc() const { - mAdapter->setServer(mNlAddr, mPort, mServerType); + if (gps_conf.AGPS_CONFIG_INJECT) { + mAdapter->setServer(mNlAddr, mPort, mServerType); + } } inline void locallog() const { LOC_LOGV("LocEngSetServerIpv4 - addr: %x, port: %d, type: %s", @@ -434,7 +440,9 @@ struct LocEngSetServerUrl : public LocMsg { delete[] mUrl; } inline virtual void proc() const { - mAdapter->setServer(mUrl, mLen); + if (gps_conf.AGPS_CONFIG_INJECT) { + mAdapter->setServer(mUrl, mLen); + } } inline void locallog() const { LOC_LOGV("LocEngSetServerUrl - url: %s", mUrl); @@ -455,7 +463,9 @@ struct LocEngAGlonassProtocol : public LocMsg { locallog(); } inline virtual void proc() const { - mAdapter->setAGLONASSProtocol(mAGlonassProtocl); + if (gps_conf.AGPS_CONFIG_INJECT) { + mAdapter->setAGLONASSProtocol(mAGlonassProtocl); + } } inline void locallog() const { LOC_LOGV("A-GLONASS protocol: 0x%lx", mAGlonassProtocl); @@ -499,7 +509,9 @@ struct LocEngSuplVer : public LocMsg { locallog(); } inline virtual void proc() const { - mAdapter->setSUPLVersion(mSuplVer); + if (gps_conf.AGPS_CONFIG_INJECT) { + mAdapter->setSUPLVersion(mSuplVer); + } } inline void locallog() const { LOC_LOGV("SUPL Version: %d", mSuplVer); @@ -563,7 +575,9 @@ struct LocEngLppConfig : public LocMsg { locallog(); } inline virtual void proc() const { - mAdapter->setLPPConfig(mLppConfig); + if (gps_conf.AGPS_CONFIG_INJECT) { + mAdapter->setLPPConfig(mLppConfig); + } } inline void locallog() const { LOC_LOGV("LocEngLppConfig - profile: %d", mLppConfig);