summaryrefslogtreecommitdiff
path: root/gnss
diff options
context:
space:
mode:
Diffstat (limited to 'gnss')
-rw-r--r--gnss/GnssAdapter.cpp54
1 files changed, 33 insertions, 21 deletions
diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp
index d165148..8c65c82 100644
--- a/gnss/GnssAdapter.cpp
+++ b/gnss/GnssAdapter.cpp
@@ -474,6 +474,16 @@ GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out,
out.flags |= GNSS_LOCATION_INFO_TIME_UNC_BIT;
out.timeUncMs = locationExtended.timeUncMs;
}
+
+ if (GPS_LOCATION_EXTENDED_HAS_CALIBRATION_CONFIDENCE & locationExtended.flags) {
+ out.flags |= GNSS_LOCATION_INFO_CALIBRATION_CONFIDENCE_BIT;
+ out.calibrationConfidence = locationExtended.calibrationConfidence;
+ }
+
+ if (GPS_LOCATION_EXTENDED_HAS_CALIBRATION_STATUS & locationExtended.flags) {
+ out.flags |= GNSS_LOCATION_INFO_CALIBRATION_STATUS_BIT;
+ out.calibrationStatus = locationExtended.calibrationStatus;
+ }
}
@@ -658,7 +668,7 @@ GnssAdapter::setSuplHostServer(const char* server, int port, LocServerType 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) {
+ if (length >= 0 && strncasecmp(url.c_str(), serverUrl, sizeof(serverUrl)) != 0) {
url.assign(serverUrl);
if (LOC_AGPS_SUPL_SERVER == type) {
@@ -836,7 +846,7 @@ 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 ((serverUrlLen != 0) && (oldServerUrl.compare(serverUrl) !=0)) {
+ if (0 != oldServerUrl.compare(serverUrl)) {
err = mLocApi->setServerSync(
serverUrl.c_str(), serverUrlLen, LOC_AGPS_SUPL_SERVER);
@@ -844,7 +854,7 @@ std::vector<LocationError> GnssAdapter::gnssUpdateConfig(const std::string& oldS
errsList[index] = err;
}
}
- if ((moServerUrlLen != 0) && (oldMoServerUrl.compare(moServerUrl) != 0)) {
+ if (0 != oldMoServerUrl.compare(moServerUrl)) {
LocationError locErr =
mLocApi->setServerSync(moServerUrl.c_str(),
moServerUrlLen,
@@ -3769,26 +3779,28 @@ GnssAdapter::reportGnssMeasurementsEvent(const GnssMeasurements& gnssMeasurement
{
LOC_LOGD("%s]: msInWeek=%d", __func__, msInWeek);
- struct MsgReportGnssMeasurementData : public LocMsg {
- GnssAdapter& mAdapter;
- GnssMeasurements mGnssMeasurements;
- GnssMeasurementsNotification mMeasurementsNotify;
- inline MsgReportGnssMeasurementData(GnssAdapter& adapter,
- const GnssMeasurements& gnssMeasurements,
- int msInWeek) :
- LocMsg(),
- mAdapter(adapter),
- mMeasurementsNotify(gnssMeasurements.gnssMeasNotification) {
- if (-1 != msInWeek) {
- mAdapter.getAgcInformation(mMeasurementsNotify, msInWeek);
+ if (0 != gnssMeasurements.gnssMeasNotification.count) {
+ struct MsgReportGnssMeasurementData : public LocMsg {
+ GnssAdapter& mAdapter;
+ GnssMeasurements mGnssMeasurements;
+ GnssMeasurementsNotification mMeasurementsNotify;
+ inline MsgReportGnssMeasurementData(GnssAdapter& adapter,
+ const GnssMeasurements& gnssMeasurements,
+ int msInWeek) :
+ LocMsg(),
+ mAdapter(adapter),
+ mMeasurementsNotify(gnssMeasurements.gnssMeasNotification) {
+ if (-1 != msInWeek) {
+ mAdapter.getAgcInformation(mMeasurementsNotify, msInWeek);
+ }
}
- }
- inline virtual void proc() const {
- mAdapter.reportGnssMeasurementData(mMeasurementsNotify);
- }
- };
+ inline virtual void proc() const {
+ mAdapter.reportGnssMeasurementData(mMeasurementsNotify);
+ }
+ };
- sendMsg(new MsgReportGnssMeasurementData(*this, gnssMeasurements, msInWeek));
+ sendMsg(new MsgReportGnssMeasurementData(*this, gnssMeasurements, msInWeek));
+ }
mEngHubProxy->gnssReportSvMeasurement(gnssMeasurements.gnssSvMeasurementSet);
}