Merge "Set SUPL_HOST to modem on GnssAdapter init."
This commit is contained in:
commit
1f8b3587f2
4 changed files with 40 additions and 25 deletions
|
@ -65,6 +65,8 @@ const loc_param_s_type ContextBase::mGps_conf_table[] =
|
||||||
{"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL", &mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, NULL, 'n'},
|
{"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL", &mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, NULL, 'n'},
|
||||||
{"AGPS_CONFIG_INJECT", &mGps_conf.AGPS_CONFIG_INJECT, NULL, 'n'},
|
{"AGPS_CONFIG_INJECT", &mGps_conf.AGPS_CONFIG_INJECT, NULL, 'n'},
|
||||||
{"EXTERNAL_DR_ENABLED", &mGps_conf.EXTERNAL_DR_ENABLED, NULL, 'n'},
|
{"EXTERNAL_DR_ENABLED", &mGps_conf.EXTERNAL_DR_ENABLED, NULL, 'n'},
|
||||||
|
{"SUPL_HOST", &mGps_conf.SUPL_HOST, NULL, 's'},
|
||||||
|
{"SUPL_PORT", &mGps_conf.SUPL_PORT, NULL, 'n'},
|
||||||
};
|
};
|
||||||
|
|
||||||
const loc_param_s_type ContextBase::mSap_conf_table[] =
|
const loc_param_s_type ContextBase::mSap_conf_table[] =
|
||||||
|
@ -98,6 +100,8 @@ void ContextBase::readConfig()
|
||||||
mGps_conf.SUPL_VER = 0x10000;
|
mGps_conf.SUPL_VER = 0x10000;
|
||||||
mGps_conf.SUPL_MODE = 0x1;
|
mGps_conf.SUPL_MODE = 0x1;
|
||||||
mGps_conf.SUPL_ES = 0;
|
mGps_conf.SUPL_ES = 0;
|
||||||
|
mGps_conf.SUPL_HOST[0] = 0;
|
||||||
|
mGps_conf.SUPL_PORT = 0;
|
||||||
mGps_conf.CAPABILITIES = 0x7;
|
mGps_conf.CAPABILITIES = 0x7;
|
||||||
/* LTE Positioning Profile configuration is disable by default*/
|
/* LTE Positioning Profile configuration is disable by default*/
|
||||||
mGps_conf.LPP_PROFILE = 0;
|
mGps_conf.LPP_PROFILE = 0;
|
||||||
|
|
|
@ -36,7 +36,8 @@
|
||||||
#include <LBSProxyBase.h>
|
#include <LBSProxyBase.h>
|
||||||
#include <loc_cfg.h>
|
#include <loc_cfg.h>
|
||||||
|
|
||||||
#define MAX_XTRA_SERVER_URL_LENGTH 256
|
#define MAX_XTRA_SERVER_URL_LENGTH (256)
|
||||||
|
#define MAX_SUPL_SERVER_URL_LENGTH (256)
|
||||||
|
|
||||||
/* GPS.conf support */
|
/* GPS.conf support */
|
||||||
/* NOTE: the implementaiton of the parser casts number
|
/* NOTE: the implementaiton of the parser casts number
|
||||||
|
@ -64,6 +65,8 @@ typedef struct loc_gps_cfg_s
|
||||||
uint32_t LPPE_CP_TECHNOLOGY;
|
uint32_t LPPE_CP_TECHNOLOGY;
|
||||||
uint32_t LPPE_UP_TECHNOLOGY;
|
uint32_t LPPE_UP_TECHNOLOGY;
|
||||||
uint32_t EXTERNAL_DR_ENABLED;
|
uint32_t EXTERNAL_DR_ENABLED;
|
||||||
|
char SUPL_HOST[MAX_SUPL_SERVER_URL_LENGTH];
|
||||||
|
uint32_t SUPL_PORT;
|
||||||
} loc_gps_cfg_s_type;
|
} loc_gps_cfg_s_type;
|
||||||
|
|
||||||
/* NOTE: the implementaiton of the parser casts number
|
/* NOTE: the implementaiton of the parser casts number
|
||||||
|
|
|
@ -522,6 +522,33 @@ GnssAdapter::readConfigCommand()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LocationError
|
||||||
|
GnssAdapter::setSuplHostServer(const char* server, int port)
|
||||||
|
{
|
||||||
|
LocationError locErr = LOCATION_ERROR_SUCCESS;
|
||||||
|
if (ContextBase::mGps_conf.AGPS_CONFIG_INJECT) {
|
||||||
|
char serverUrl[MAX_URL_LEN] = {};
|
||||||
|
int32_t length = 0;
|
||||||
|
const char noHost[] = "NONE";
|
||||||
|
if ((NULL == server) || (server[0] == 0) || (port == 0) ||
|
||||||
|
(strncasecmp(noHost, server, sizeof(noHost)) == 0)) {
|
||||||
|
locErr = LOCATION_ERROR_INVALID_PARAMETER;
|
||||||
|
} else {
|
||||||
|
length = snprintf(serverUrl, sizeof(serverUrl), "%s:%u", server, port);
|
||||||
|
if (length > 0 && strncasecmp(getServerUrl().c_str(),
|
||||||
|
serverUrl, sizeof(serverUrl)) != 0) {
|
||||||
|
setServerUrl(serverUrl);
|
||||||
|
locErr = mLocApi->setServer(serverUrl, length);
|
||||||
|
if (locErr != LOCATION_ERROR_SUCCESS) {
|
||||||
|
LOC_LOGE("%s]:Error while setting SUPL_HOST server:%s",
|
||||||
|
__func__, serverUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return locErr;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
GnssAdapter::setConfigCommand()
|
GnssAdapter::setConfigCommand()
|
||||||
{
|
{
|
||||||
|
@ -541,6 +568,8 @@ GnssAdapter::setConfigCommand()
|
||||||
mApi.setLPPConfig(mAdapter.convertLppProfile(ContextBase::mGps_conf.LPP_PROFILE));
|
mApi.setLPPConfig(mAdapter.convertLppProfile(ContextBase::mGps_conf.LPP_PROFILE));
|
||||||
mApi.setAGLONASSProtocol(ContextBase::mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT);
|
mApi.setAGLONASSProtocol(ContextBase::mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT);
|
||||||
}
|
}
|
||||||
|
mAdapter.setSuplHostServer(ContextBase::mGps_conf.SUPL_HOST,
|
||||||
|
ContextBase::mGps_conf.SUPL_PORT);
|
||||||
mApi.setSensorControlConfig(ContextBase::mSap_conf.SENSOR_USAGE,
|
mApi.setSensorControlConfig(ContextBase::mSap_conf.SENSOR_USAGE,
|
||||||
ContextBase::mSap_conf.SENSOR_PROVIDER);
|
ContextBase::mSap_conf.SENSOR_PROVIDER);
|
||||||
mApi.setLPPeProtocolCp(
|
mApi.setLPPeProtocolCp(
|
||||||
|
@ -674,30 +703,8 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
||||||
}
|
}
|
||||||
if (mConfig.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) {
|
if (mConfig.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) {
|
||||||
if (GNSS_ASSISTANCE_TYPE_SUPL == mConfig.assistanceServer.type) {
|
if (GNSS_ASSISTANCE_TYPE_SUPL == mConfig.assistanceServer.type) {
|
||||||
if (ContextBase::mGps_conf.AGPS_CONFIG_INJECT) {
|
err = mAdapter.setSuplHostServer(mConfig.assistanceServer.hostName,
|
||||||
char serverUrl[MAX_URL_LEN] = {};
|
|
||||||
int32_t length = 0;
|
|
||||||
const char noHost[] = "NONE";
|
|
||||||
if (NULL == mConfig.assistanceServer.hostName ||
|
|
||||||
strncasecmp(noHost,
|
|
||||||
mConfig.assistanceServer.hostName,
|
|
||||||
sizeof(noHost)) == 0) {
|
|
||||||
err = LOCATION_ERROR_INVALID_PARAMETER;
|
|
||||||
} else {
|
|
||||||
length = snprintf(serverUrl, sizeof(serverUrl), "%s:%u",
|
|
||||||
mConfig.assistanceServer.hostName,
|
|
||||||
mConfig.assistanceServer.port);
|
mConfig.assistanceServer.port);
|
||||||
}
|
|
||||||
|
|
||||||
if (length > 0 && strncasecmp(mAdapter.getServerUrl().c_str(),
|
|
||||||
serverUrl, sizeof(serverUrl)) != 0) {
|
|
||||||
mAdapter.setServerUrl(serverUrl);
|
|
||||||
err = mApi.setServer(serverUrl, length);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
err = LOCATION_ERROR_SUCCESS;
|
|
||||||
}
|
|
||||||
} else if (GNSS_ASSISTANCE_TYPE_C2K == mConfig.assistanceServer.type) {
|
} else if (GNSS_ASSISTANCE_TYPE_C2K == mConfig.assistanceServer.type) {
|
||||||
if (ContextBase::mGps_conf.AGPS_CONFIG_INJECT) {
|
if (ContextBase::mGps_conf.AGPS_CONFIG_INJECT) {
|
||||||
struct in_addr addr;
|
struct in_addr addr;
|
||||||
|
|
|
@ -151,6 +151,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);
|
||||||
|
|
||||||
/* ==== TRACKING ======================================================================= */
|
/* ==== TRACKING ======================================================================= */
|
||||||
/* ======== COMMANDS ====(Called from Client Thread)==================================== */
|
/* ======== COMMANDS ====(Called from Client Thread)==================================== */
|
||||||
|
|
Loading…
Reference in a new issue