summaryrefslogtreecommitdiff
path: root/core/SystemStatus.cpp
diff options
context:
space:
mode:
authorKatz Yamada <kyamada@codeaurora.org>2017-06-06 10:04:43 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-06-06 13:54:28 -0700
commit58d74dc1bddc9933c63c3877a934658f9788bc54 (patch)
treeebbbef758ad2094533cd8d648faed127a797473b /core/SystemStatus.cpp
parent876db406414d985d41d582f1ec4ad97b7c5a8313 (diff)
downloadgps-58d74dc1bddc9933c63c3877a934658f9788bc54.tar.gz
Add set default report API in systemstatus
Add an API to set default report data cached in systemstatus. Call this API when delete all aiding data is requested, so that bugreport has all default values. Bug: 62068956 Change-Id: I76d661c6a89a1644aef2a8f47253ce9cc0d727fb CRs-Fixed: 2054705
Diffstat (limited to 'core/SystemStatus.cpp')
-rw-r--r--core/SystemStatus.cpp72
1 files changed, 72 insertions, 0 deletions
diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp
index 80406f6..939005d 100644
--- a/core/SystemStatus.cpp
+++ b/core/SystemStatus.cpp
@@ -873,6 +873,7 @@ void SystemStatusInjectedPosition::dump()
SystemStatusBestPosition
******************************************************************************/
SystemStatusBestPosition::SystemStatusBestPosition(const SystemStatusPQWP2& nmea) :
+ mValid(true),
mBestLat(nmea.mBestLat),
mBestLon(nmea.mBestLon),
mBestAlt(nmea.mBestAlt),
@@ -1598,5 +1599,76 @@ bool SystemStatus::getReport(SystemStatusReports& report, bool isLatestOnly) con
return true;
}
+/******************************************************************************
+@brief API to set default report data
+
+@param[In] none
+
+@return true when successfully done
+******************************************************************************/
+bool SystemStatus::setDefaultReport(void)
+{
+ pthread_mutex_lock(&mMutexSystemStatus);
+
+ mCache.mLocation.push_back(SystemStatusLocation());
+ if (mCache.mLocation.size() > maxLocation) {
+ mCache.mLocation.erase(mCache.mLocation.begin());
+ }
+
+ mCache.mTimeAndClock.push_back(SystemStatusTimeAndClock());
+ if (mCache.mTimeAndClock.size() > maxTimeAndClock) {
+ mCache.mTimeAndClock.erase(mCache.mTimeAndClock.begin());
+ }
+ mCache.mXoState.push_back(SystemStatusXoState());
+ if (mCache.mXoState.size() > maxXoState) {
+ mCache.mXoState.erase(mCache.mXoState.begin());
+ }
+ mCache.mRfAndParams.push_back(SystemStatusRfAndParams());
+ if (mCache.mRfAndParams.size() > maxRfAndParams) {
+ mCache.mRfAndParams.erase(mCache.mRfAndParams.begin());
+ }
+ mCache.mErrRecovery.push_back(SystemStatusErrRecovery());
+ if (mCache.mErrRecovery.size() > maxErrRecovery) {
+ mCache.mErrRecovery.erase(mCache.mErrRecovery.begin());
+ }
+
+ mCache.mInjectedPosition.push_back(SystemStatusInjectedPosition());
+ if (mCache.mInjectedPosition.size() > maxInjectedPosition) {
+ mCache.mInjectedPosition.erase(mCache.mInjectedPosition.begin());
+ }
+ mCache.mBestPosition.push_back(SystemStatusBestPosition());
+ if (mCache.mBestPosition.size() > maxBestPosition) {
+ mCache.mBestPosition.erase(mCache.mBestPosition.begin());
+ }
+ mCache.mXtra.push_back(SystemStatusXtra());
+ if (mCache.mXtra.size() > maxXtra) {
+ mCache.mXtra.erase(mCache.mXtra.begin());
+ }
+ mCache.mEphemeris.push_back(SystemStatusEphemeris());
+ if (mCache.mEphemeris.size() > maxEphemeris) {
+ mCache.mEphemeris.erase(mCache.mEphemeris.begin());
+ }
+ mCache.mSvHealth.push_back(SystemStatusSvHealth());
+ if (mCache.mSvHealth.size() > maxSvHealth) {
+ mCache.mSvHealth.erase(mCache.mSvHealth.begin());
+ }
+ mCache.mPdr.push_back(SystemStatusPdr());
+ if (mCache.mPdr.size() > maxPdr) {
+ mCache.mPdr.erase(mCache.mPdr.begin());
+ }
+ mCache.mNavData.push_back(SystemStatusNavData());
+ if (mCache.mNavData.size() > maxNavData) {
+ mCache.mNavData.erase(mCache.mNavData.begin());
+ }
+
+ mCache.mPositionFailure.push_back(SystemStatusPositionFailure());
+ if (mCache.mPositionFailure.size() > maxPositionFailure) {
+ mCache.mPositionFailure.erase(mCache.mPositionFailure.begin());
+ }
+
+ pthread_mutex_unlock(&mMutexSystemStatus);
+ return true;
+}
+
} // namespace loc_core