Merge "Drop SUPL URL dup check in set and update command"
This commit is contained in:
commit
3e3390bbd5
2 changed files with 21 additions and 32 deletions
|
@ -666,17 +666,15 @@ GnssAdapter::setSuplHostServer(const char* server, int port, LocServerType type)
|
|||
}
|
||||
if (LOC_AGPS_SUPL_SERVER != type && LOC_AGPS_MO_SUPL_SERVER != type) {
|
||||
LOC_LOGe("Invalid type=%d", type);
|
||||
} else {
|
||||
string& url = (LOC_AGPS_SUPL_SERVER == type) ? getServerUrl() : getMoServerUrl();
|
||||
if (length >= 0 && strncasecmp(url.c_str(), serverUrl, sizeof(serverUrl)) != 0) {
|
||||
url.assign(serverUrl);
|
||||
|
||||
if (LOC_AGPS_SUPL_SERVER == type) {
|
||||
strlcpy(ContextBase::mGps_conf.SUPL_HOST, server, LOC_MAX_PARAM_STRING);
|
||||
ContextBase::mGps_conf.SUPL_PORT = port;
|
||||
} else if (length >= 0) {
|
||||
if (LOC_AGPS_SUPL_SERVER == type) {
|
||||
getServerUrl().assign(serverUrl);
|
||||
strlcpy(ContextBase::mGps_conf.SUPL_HOST, server, LOC_MAX_PARAM_STRING);
|
||||
ContextBase::mGps_conf.SUPL_PORT = port;
|
||||
} else {
|
||||
if (strncasecmp(getMoServerUrl().c_str(), serverUrl, sizeof(serverUrl)) != 0) {
|
||||
getMoServerUrl().assign(serverUrl);
|
||||
}
|
||||
|
||||
LOC_LOGv("serverUrl=%s length=%d type=%d", serverUrl, length, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -709,7 +707,6 @@ GnssAdapter::setConfigCommand()
|
|||
}
|
||||
mAdapter.mNmeaMask= mask;
|
||||
|
||||
std::string oldServerUrl = mAdapter.getServerUrl();
|
||||
std::string oldMoServerUrl = mAdapter.getMoServerUrl();
|
||||
mAdapter.setSuplHostServer(ContextBase::mGps_conf.SUPL_HOST,
|
||||
ContextBase::mGps_conf.SUPL_PORT,
|
||||
|
@ -750,10 +747,8 @@ GnssAdapter::setConfigCommand()
|
|||
gnssConfigRequested.blacklistedSvIds.assign(adapter.mBlacklistedSvIds.begin(),
|
||||
adapter.mBlacklistedSvIds.end());
|
||||
mApi.sendMsg(new LocApiMsg(
|
||||
[&adapter, gpsConf, sapConf, oldServerUrl,
|
||||
oldMoServerUrl, gnssConfigRequested] () {
|
||||
adapter.gnssUpdateConfig(oldServerUrl, oldMoServerUrl, gnssConfigRequested,
|
||||
gnssConfigRequested);
|
||||
[&adapter, gpsConf, sapConf, oldMoServerUrl, gnssConfigRequested] () {
|
||||
adapter.gnssUpdateConfig(oldMoServerUrl, gnssConfigRequested, gnssConfigRequested);
|
||||
|
||||
// set nmea mask type
|
||||
uint32_t mask = 0;
|
||||
|
@ -812,8 +807,8 @@ GnssAdapter::setConfigCommand()
|
|||
sendMsg(new MsgSetConfig(*this, *mLocApi));
|
||||
}
|
||||
|
||||
std::vector<LocationError> GnssAdapter::gnssUpdateConfig(const std::string& oldServerUrl,
|
||||
const std::string& oldMoServerUrl, const GnssConfig& gnssConfigRequested,
|
||||
std::vector<LocationError> GnssAdapter::gnssUpdateConfig(const std::string& oldMoServerUrl,
|
||||
const GnssConfig& gnssConfigRequested,
|
||||
const GnssConfig& gnssConfigNeedEngineUpdate, size_t count) {
|
||||
loc_gps_cfg_s gpsConf = ContextBase::mGps_conf;
|
||||
size_t index = 0;
|
||||
|
@ -846,13 +841,10 @@ std::vector<LocationError> GnssAdapter::gnssUpdateConfig(const std::string& oldS
|
|||
GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) {
|
||||
if (gnssConfigNeedEngineUpdate.assistanceServer.type ==
|
||||
GNSS_ASSISTANCE_TYPE_SUPL) {
|
||||
if (0 != oldServerUrl.compare(serverUrl)) {
|
||||
|
||||
err = mLocApi->setServerSync(
|
||||
serverUrl.c_str(), serverUrlLen, LOC_AGPS_SUPL_SERVER);
|
||||
if (index < count) {
|
||||
errsList[index] = err;
|
||||
}
|
||||
err = mLocApi->setServerSync(
|
||||
serverUrl.c_str(), serverUrlLen, LOC_AGPS_SUPL_SERVER);
|
||||
if (index < count) {
|
||||
errsList[index] = err;
|
||||
}
|
||||
if (0 != oldMoServerUrl.compare(moServerUrl)) {
|
||||
LocationError locErr =
|
||||
|
@ -1069,7 +1061,6 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
|||
size_t countOfConfigs = mCount;
|
||||
GnssConfig gnssConfigRequested = mConfig;
|
||||
GnssConfig gnssConfigNeedEngineUpdate = mConfig;
|
||||
std::string oldServerUrl = mAdapter.getServerUrl();
|
||||
|
||||
std::vector<uint32_t> sessionIds;
|
||||
sessionIds.assign(mIds, mIds + mCount);
|
||||
|
@ -1162,11 +1153,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
|||
|
||||
mApi.sendMsg(new LocApiMsg(
|
||||
[&adapter, gnssConfigRequested, gnssConfigNeedEngineUpdate,
|
||||
countOfConfigs, configCollectiveResponse, errs, oldServerUrl] () {
|
||||
std::string serverUrl = adapter.getServerUrl();
|
||||
int serverUrlLen = serverUrl.length();
|
||||
std::vector<LocationError> errsList = adapter.gnssUpdateConfig(oldServerUrl,
|
||||
"", gnssConfigRequested, gnssConfigNeedEngineUpdate, countOfConfigs);
|
||||
countOfConfigs, configCollectiveResponse, errs] () {
|
||||
std::vector<LocationError> errsList = adapter.gnssUpdateConfig("",
|
||||
gnssConfigRequested, gnssConfigNeedEngineUpdate, countOfConfigs);
|
||||
|
||||
configCollectiveResponse->returnToSender(errsList);
|
||||
}));
|
||||
|
|
|
@ -289,8 +289,8 @@ public:
|
|||
uint32_t gnssDeleteAidingDataCommand(GnssAidingData& data);
|
||||
void deleteAidingData(const GnssAidingData &data, uint32_t sessionId);
|
||||
void gnssUpdateXtraThrottleCommand(const bool enabled);
|
||||
std::vector<LocationError> gnssUpdateConfig(const std::string& oldServerUrl,
|
||||
const std::string& oldMoServerUrl, const GnssConfig& gnssConfigRequested,
|
||||
std::vector<LocationError> gnssUpdateConfig(const std::string& oldMoServerUrl,
|
||||
const GnssConfig& gnssConfigRequested,
|
||||
const GnssConfig& gnssConfigNeedEngineUpdate, size_t count = 0);
|
||||
|
||||
/* ==== GNSS SV TYPE CONFIG ============================================================ */
|
||||
|
|
Loading…
Reference in a new issue