Combine updateConfig in GnssAdapter
Adjust setConfigCommand and gnssUpdateConfigCommand to use one gnssUpdateConfig method. CRs-fixed: 2402752 Change-Id: I6a9ec474bd9ffed52edd2422574af0f6d41493c4
This commit is contained in:
parent
ae8db6cf15
commit
6b687ef48e
2 changed files with 207 additions and 175 deletions
|
@ -681,45 +681,36 @@ GnssAdapter::setConfigCommand()
|
||||||
|
|
||||||
mApi.sendMsg(new LocApiMsg(
|
mApi.sendMsg(new LocApiMsg(
|
||||||
[&adapter, gpsConf, sapConf, oldServerUrl, oldMoServerUrl] () {
|
[&adapter, gpsConf, sapConf, oldServerUrl, oldMoServerUrl] () {
|
||||||
|
//cache the injected configuration with GnssConfigRequested struct
|
||||||
std::string serverUrl = adapter.getServerUrl();
|
GnssConfig gnssConfigRequested = {};
|
||||||
std::string moServerUrl = adapter.getMoServerUrl();
|
gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT |
|
||||||
int serverUrlLen = serverUrl.length();
|
GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT |
|
||||||
int moServerUrlLen = moServerUrl.length();
|
GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT |
|
||||||
|
GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT;
|
||||||
|
gnssConfigRequested.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE;
|
||||||
|
if (0 == adapter.getPowerVoteId()) {
|
||||||
|
gnssConfigRequested.gpsLock = adapter.convertGpsLock(gpsConf.GPS_LOCK);
|
||||||
|
}
|
||||||
|
|
||||||
if (gpsConf.AGPS_CONFIG_INJECT) {
|
if (gpsConf.AGPS_CONFIG_INJECT) {
|
||||||
adapter.mLocApi->setSUPLVersionSync(
|
gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT |
|
||||||
adapter.mLocApi->convertSuplVersion(gpsConf.SUPL_VER));
|
GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT |
|
||||||
adapter.mLocApi->setLPPConfigSync(
|
GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT;
|
||||||
adapter.mLocApi->convertLppProfile(gpsConf.LPP_PROFILE));
|
gnssConfigRequested.suplVersion =
|
||||||
adapter.mLocApi->setAGLONASSProtocolSync(
|
adapter.mLocApi->convertSuplVersion(gpsConf.SUPL_VER);
|
||||||
gpsConf.A_GLONASS_POS_PROTOCOL_SELECT);
|
gnssConfigRequested.lppProfile =
|
||||||
|
adapter.mLocApi->convertLppProfile(gpsConf.LPP_PROFILE);
|
||||||
|
gnssConfigRequested.aGlonassPositionProtocolMask =
|
||||||
|
gpsConf.A_GLONASS_POS_PROTOCOL_SELECT;
|
||||||
}
|
}
|
||||||
|
gnssConfigRequested.lppeControlPlaneMask =
|
||||||
if ((serverUrlLen !=0) && (oldServerUrl.compare(serverUrl) != 0)) {
|
adapter.mLocApi->convertLppeCp(gpsConf.LPPE_CP_TECHNOLOGY);
|
||||||
LocationError locErr =
|
gnssConfigRequested.lppeUserPlaneMask =
|
||||||
adapter.mLocApi->setServerSync(serverUrl.c_str(), serverUrlLen,
|
adapter.mLocApi->convertLppeUp(gpsConf.LPPE_UP_TECHNOLOGY);
|
||||||
LOC_AGPS_SUPL_SERVER);
|
gnssConfigRequested.blacklistedSvIds.assign(adapter.mBlacklistedSvIds.begin(),
|
||||||
if (locErr != LOCATION_ERROR_SUCCESS) {
|
adapter.mBlacklistedSvIds.end());
|
||||||
LOC_LOGe("Error while setting SUPL_HOST server:%s",
|
adapter.gnssUpdateConfig(oldServerUrl, oldMoServerUrl, gnssConfigRequested,
|
||||||
serverUrl.c_str());
|
gnssConfigRequested);
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((moServerUrlLen != 0) && (oldMoServerUrl.compare(moServerUrl) != 0)) {
|
|
||||||
LocationError locErr =
|
|
||||||
adapter.mLocApi->setServerSync(moServerUrl.c_str(),
|
|
||||||
moServerUrlLen,
|
|
||||||
LOC_AGPS_MO_SUPL_SERVER);
|
|
||||||
if (locErr != LOCATION_ERROR_SUCCESS) {
|
|
||||||
LOC_LOGe("Error while setting MO SUPL_HOST server:%s",
|
|
||||||
moServerUrl.c_str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
adapter.mLocApi->setLPPeProtocolCpSync(
|
|
||||||
adapter.mLocApi->convertLppeCp(gpsConf.LPPE_CP_TECHNOLOGY));
|
|
||||||
adapter.mLocApi->setLPPeProtocolUpSync(
|
|
||||||
adapter.mLocApi->convertLppeUp(gpsConf.LPPE_UP_TECHNOLOGY));
|
|
||||||
|
|
||||||
// set nmea mask type
|
// set nmea mask type
|
||||||
uint32_t mask = 0;
|
uint32_t mask = 0;
|
||||||
|
@ -778,6 +769,180 @@ GnssAdapter::setConfigCommand()
|
||||||
sendMsg(new MsgSetConfig(*this, *mLocApi));
|
sendMsg(new MsgSetConfig(*this, *mLocApi));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<LocationError> GnssAdapter::gnssUpdateConfig(const std::string& oldServerUrl,
|
||||||
|
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;
|
||||||
|
LocationError err = LOCATION_ERROR_SUCCESS;
|
||||||
|
std::vector<LocationError> errsList = {err};
|
||||||
|
if (count > 0) {
|
||||||
|
errsList.insert(errsList.begin(), count, LOCATION_ERROR_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::string serverUrl = getServerUrl();
|
||||||
|
std::string moServerUrl = getMoServerUrl();
|
||||||
|
|
||||||
|
int serverUrlLen = serverUrl.length();
|
||||||
|
int moServerUrlLen = moServerUrl.length();
|
||||||
|
|
||||||
|
if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) {
|
||||||
|
if (gnssConfigNeedEngineUpdate.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) {
|
||||||
|
err = mLocApi->setGpsLockSync(gnssConfigRequested.gpsLock);
|
||||||
|
if (index < count) {
|
||||||
|
errsList[index] = err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gnssConfigRequested.flags &
|
||||||
|
GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) {
|
||||||
|
if (gnssConfigNeedEngineUpdate.flags &
|
||||||
|
GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) {
|
||||||
|
if (gnssConfigNeedEngineUpdate.assistanceServer.type ==
|
||||||
|
GNSS_ASSISTANCE_TYPE_SUPL) {
|
||||||
|
if ((serverUrlLen != 0) && (oldServerUrl.compare(serverUrl) !=0)) {
|
||||||
|
|
||||||
|
err = mLocApi->setServerSync(
|
||||||
|
serverUrl.c_str(), serverUrlLen, LOC_AGPS_SUPL_SERVER);
|
||||||
|
if (index < count) {
|
||||||
|
errsList[index] = err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((moServerUrlLen != 0) && (oldMoServerUrl.compare(moServerUrl) != 0)) {
|
||||||
|
LocationError locErr =
|
||||||
|
mLocApi->setServerSync(moServerUrl.c_str(),
|
||||||
|
moServerUrlLen,
|
||||||
|
LOC_AGPS_MO_SUPL_SERVER);
|
||||||
|
if (locErr != LOCATION_ERROR_SUCCESS) {
|
||||||
|
LOC_LOGe("Error while setting MO SUPL_HOST server:%s",
|
||||||
|
moServerUrl.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (gnssConfigNeedEngineUpdate.assistanceServer.type ==
|
||||||
|
GNSS_ASSISTANCE_TYPE_C2K) {
|
||||||
|
struct in_addr addr;
|
||||||
|
struct hostent* hp;
|
||||||
|
bool resolveAddrSuccess = true;
|
||||||
|
|
||||||
|
hp = gethostbyname(
|
||||||
|
gnssConfigNeedEngineUpdate.assistanceServer.hostName);
|
||||||
|
if (hp != NULL) { /* DNS OK */
|
||||||
|
memcpy(&addr, hp->h_addr_list[0], hp->h_length);
|
||||||
|
} else {
|
||||||
|
/* Try IP representation */
|
||||||
|
if (inet_aton(
|
||||||
|
gnssConfigNeedEngineUpdate.assistanceServer.hostName,
|
||||||
|
&addr) == 0) {
|
||||||
|
/* IP not valid */
|
||||||
|
LOC_LOGE("%s]: hostname '%s' cannot be resolved ",
|
||||||
|
__func__,
|
||||||
|
gnssConfigNeedEngineUpdate.assistanceServer.hostName);
|
||||||
|
if (index < count) {
|
||||||
|
errsList[index] = LOCATION_ERROR_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resolveAddrSuccess = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (resolveAddrSuccess) {
|
||||||
|
unsigned int ip = htonl(addr.s_addr);
|
||||||
|
err = mLocApi->setServerSync(ip,
|
||||||
|
gnssConfigNeedEngineUpdate.assistanceServer.port,
|
||||||
|
LOC_AGPS_CDMA_PDE_SERVER);
|
||||||
|
if (index < count) {
|
||||||
|
errsList[index] = err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) {
|
||||||
|
if (gnssConfigNeedEngineUpdate.flags &
|
||||||
|
GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) {
|
||||||
|
err = mLocApi->setSUPLVersionSync(gnssConfigRequested.suplVersion);
|
||||||
|
if (index < count) {
|
||||||
|
errsList[index] = err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) {
|
||||||
|
if (gnssConfigNeedEngineUpdate.flags &
|
||||||
|
GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) {
|
||||||
|
err = mLocApi->setLPPConfigSync(gnssConfigRequested.lppProfile);
|
||||||
|
if (index < count) {
|
||||||
|
errsList[index] = err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) {
|
||||||
|
if (gnssConfigNeedEngineUpdate.flags &
|
||||||
|
GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) {
|
||||||
|
err = mLocApi->setLPPeProtocolCpSync(
|
||||||
|
gnssConfigRequested.lppeControlPlaneMask);
|
||||||
|
if (index < count) {
|
||||||
|
errsList[index] = err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) {
|
||||||
|
if (gnssConfigNeedEngineUpdate.flags &
|
||||||
|
GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) {
|
||||||
|
err = mLocApi->setLPPeProtocolUpSync(
|
||||||
|
gnssConfigRequested.lppeUserPlaneMask);
|
||||||
|
if (index < count) {
|
||||||
|
errsList[index] = err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gnssConfigRequested.flags &
|
||||||
|
GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) {
|
||||||
|
if (gnssConfigNeedEngineUpdate.flags &
|
||||||
|
GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) {
|
||||||
|
err = mLocApi->setAGLONASSProtocolSync(
|
||||||
|
gnssConfigRequested.aGlonassPositionProtocolMask);
|
||||||
|
if (index < count) {
|
||||||
|
errsList[index] = err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT) {
|
||||||
|
// Check if feature is supported
|
||||||
|
if (!ContextBase::isFeatureSupported(
|
||||||
|
LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02)) {
|
||||||
|
LOC_LOGe("Feature constellation enablement not supported.");
|
||||||
|
err = LOCATION_ERROR_NOT_SUPPORTED;
|
||||||
|
} else {
|
||||||
|
// Send the SV ID Config to Modem
|
||||||
|
mBlacklistedSvIds.assign(gnssConfigRequested.blacklistedSvIds.begin(),
|
||||||
|
gnssConfigRequested.blacklistedSvIds.end());
|
||||||
|
err = gnssSvIdConfigUpdateSync(gnssConfigRequested.blacklistedSvIds);
|
||||||
|
if (LOCATION_ERROR_SUCCESS != err) {
|
||||||
|
LOC_LOGe("Failed to send config to modem, err %d", err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (index < count) {
|
||||||
|
errsList[index] = err;
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
return errsList;
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t*
|
uint32_t*
|
||||||
GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
||||||
{
|
{
|
||||||
|
@ -962,148 +1127,11 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
||||||
mApi.sendMsg(new LocApiMsg(
|
mApi.sendMsg(new LocApiMsg(
|
||||||
[&adapter, gnssConfigRequested, gnssConfigNeedEngineUpdate,
|
[&adapter, gnssConfigRequested, gnssConfigNeedEngineUpdate,
|
||||||
countOfConfigs, configCollectiveResponse, errs, oldServerUrl] () {
|
countOfConfigs, configCollectiveResponse, errs, oldServerUrl] () {
|
||||||
|
|
||||||
size_t index = 0;
|
|
||||||
LocationError err = LOCATION_ERROR_SUCCESS;
|
|
||||||
std::vector<LocationError> errsList(errs);
|
|
||||||
|
|
||||||
std::string serverUrl = adapter.getServerUrl();
|
std::string serverUrl = adapter.getServerUrl();
|
||||||
int serverUrlLen = serverUrl.length();
|
int serverUrlLen = serverUrl.length();
|
||||||
|
std::vector<LocationError> errsList = adapter.gnssUpdateConfig(oldServerUrl,
|
||||||
|
"", gnssConfigRequested, gnssConfigNeedEngineUpdate, countOfConfigs);
|
||||||
|
|
||||||
if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) {
|
|
||||||
if (gnssConfigNeedEngineUpdate.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) {
|
|
||||||
err = adapter.mLocApi->setGpsLockSync(gnssConfigRequested.gpsLock);
|
|
||||||
if (index < countOfConfigs) {
|
|
||||||
errsList[index] = err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
if (gnssConfigRequested.flags &
|
|
||||||
GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) {
|
|
||||||
if (gnssConfigNeedEngineUpdate.flags &
|
|
||||||
GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) {
|
|
||||||
if (gnssConfigNeedEngineUpdate.assistanceServer.type ==
|
|
||||||
GNSS_ASSISTANCE_TYPE_SUPL) {
|
|
||||||
if ((serverUrlLen != 0) && (oldServerUrl.compare(serverUrl) !=0)) {
|
|
||||||
err = adapter.mLocApi->setServerSync(
|
|
||||||
serverUrl.c_str(), serverUrlLen, LOC_AGPS_SUPL_SERVER);
|
|
||||||
if (index < countOfConfigs) {
|
|
||||||
errsList[index] = err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (gnssConfigNeedEngineUpdate.assistanceServer.type ==
|
|
||||||
GNSS_ASSISTANCE_TYPE_C2K) {
|
|
||||||
struct in_addr addr;
|
|
||||||
struct hostent* hp;
|
|
||||||
bool resolveAddrSuccess = true;
|
|
||||||
|
|
||||||
hp = gethostbyname(
|
|
||||||
gnssConfigNeedEngineUpdate.assistanceServer.hostName);
|
|
||||||
if (hp != NULL) { /* DNS OK */
|
|
||||||
memcpy(&addr, hp->h_addr_list[0], hp->h_length);
|
|
||||||
} else {
|
|
||||||
/* Try IP representation */
|
|
||||||
if (inet_aton(
|
|
||||||
gnssConfigNeedEngineUpdate.assistanceServer.hostName,
|
|
||||||
&addr) == 0) {
|
|
||||||
/* IP not valid */
|
|
||||||
LOC_LOGE("%s]: hostname '%s' cannot be resolved ",
|
|
||||||
__func__,
|
|
||||||
gnssConfigNeedEngineUpdate.assistanceServer.hostName);
|
|
||||||
if (index < countOfConfigs) {
|
|
||||||
errsList[index] = LOCATION_ERROR_INVALID_PARAMETER;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
resolveAddrSuccess = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (resolveAddrSuccess) {
|
|
||||||
unsigned int ip = htonl(addr.s_addr);
|
|
||||||
err = adapter.mLocApi->setServerSync(ip,
|
|
||||||
gnssConfigNeedEngineUpdate.assistanceServer.port,
|
|
||||||
LOC_AGPS_CDMA_PDE_SERVER);
|
|
||||||
if (index < countOfConfigs) {
|
|
||||||
errsList[index] = err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) {
|
|
||||||
if (gnssConfigNeedEngineUpdate.flags &
|
|
||||||
GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) {
|
|
||||||
err = adapter.mLocApi->setSUPLVersionSync(gnssConfigRequested.suplVersion);
|
|
||||||
if (index < countOfConfigs) {
|
|
||||||
errsList[index] = err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) {
|
|
||||||
if (gnssConfigNeedEngineUpdate.flags &
|
|
||||||
GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) {
|
|
||||||
err = adapter.mLocApi->setLPPConfigSync(gnssConfigRequested.lppProfile);
|
|
||||||
if (index < countOfConfigs) {
|
|
||||||
errsList[index] = err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) {
|
|
||||||
if (gnssConfigNeedEngineUpdate.flags &
|
|
||||||
GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) {
|
|
||||||
err = adapter.mLocApi->setLPPeProtocolCpSync(
|
|
||||||
gnssConfigRequested.lppeControlPlaneMask);
|
|
||||||
if (index < countOfConfigs) {
|
|
||||||
errsList[index] = err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) {
|
|
||||||
if (gnssConfigNeedEngineUpdate.flags &
|
|
||||||
GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) {
|
|
||||||
err = adapter.mLocApi->setLPPeProtocolUpSync(
|
|
||||||
gnssConfigRequested.lppeUserPlaneMask);
|
|
||||||
if (index < countOfConfigs) {
|
|
||||||
errsList[index] = err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
if (gnssConfigRequested.flags &
|
|
||||||
GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) {
|
|
||||||
if (gnssConfigNeedEngineUpdate.flags &
|
|
||||||
GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) {
|
|
||||||
err = adapter.mLocApi->setAGLONASSProtocolSync(
|
|
||||||
gnssConfigRequested.aGlonassPositionProtocolMask);
|
|
||||||
if (index < countOfConfigs) {
|
|
||||||
errsList[index] = err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT) {
|
|
||||||
// Check if feature is supported
|
|
||||||
if (!ContextBase::isFeatureSupported(
|
|
||||||
LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02)) {
|
|
||||||
LOC_LOGe("Feature constellation enablement not supported.");
|
|
||||||
err = LOCATION_ERROR_NOT_SUPPORTED;
|
|
||||||
} else {
|
|
||||||
// Send the SV ID Config to Modem
|
|
||||||
err = adapter.gnssSvIdConfigUpdateSync(gnssConfigRequested.blacklistedSvIds);
|
|
||||||
if (LOCATION_ERROR_SUCCESS != err) {
|
|
||||||
LOC_LOGe("Failed to send config to modem, err %d", err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (index < countOfConfigs) {
|
|
||||||
errsList[index] = err;
|
|
||||||
}
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
configCollectiveResponse->returnToSender(errsList);
|
configCollectiveResponse->returnToSender(errsList);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,6 +175,7 @@ class GnssAdapter : public LocAdapterBase {
|
||||||
std::string mMoServerUrl;
|
std::string mMoServerUrl;
|
||||||
XtraSystemStatusObserver mXtraObserver;
|
XtraSystemStatusObserver mXtraObserver;
|
||||||
LocationSystemInfo mLocSystemInfo;
|
LocationSystemInfo mLocSystemInfo;
|
||||||
|
std::vector<GnssSvIdSource> mBlacklistedSvIds;
|
||||||
|
|
||||||
/* === Misc ===================================================================== */
|
/* === Misc ===================================================================== */
|
||||||
BlockCPIInfo mBlockCPIInfo;
|
BlockCPIInfo mBlockCPIInfo;
|
||||||
|
@ -278,6 +279,9 @@ public:
|
||||||
uint32_t gnssDeleteAidingDataCommand(GnssAidingData& data);
|
uint32_t gnssDeleteAidingDataCommand(GnssAidingData& data);
|
||||||
void deleteAidingData(const GnssAidingData &data, uint32_t sessionId);
|
void deleteAidingData(const GnssAidingData &data, uint32_t sessionId);
|
||||||
void gnssUpdateXtraThrottleCommand(const bool enabled);
|
void gnssUpdateXtraThrottleCommand(const bool enabled);
|
||||||
|
std::vector<LocationError> gnssUpdateConfig(const std::string& oldServerUrl,
|
||||||
|
const std::string& oldMoServerUrl, const GnssConfig& gnssConfigRequested,
|
||||||
|
const GnssConfig& gnssConfigNeedEngineUpdate, size_t count = 0);
|
||||||
|
|
||||||
/* ==== GNSS SV TYPE CONFIG ============================================================ */
|
/* ==== GNSS SV TYPE CONFIG ============================================================ */
|
||||||
/* ==== COMMANDS ====(Called from Client Thread)======================================== */
|
/* ==== COMMANDS ====(Called from Client Thread)======================================== */
|
||||||
|
|
Loading…
Reference in a new issue