diff options
author | Katz Yamada <kyamada@codeaurora.org> | 2018-05-11 14:59:44 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-05-01 13:42:21 -0700 |
commit | 2c71ec9e02ea234106d520717fc36eb4f3ad7c48 (patch) | |
tree | c2382520b4b40ec1107b11e8bb660e4f512b7002 /gnss | |
parent | e7c30fa882af46d23f9eddf78fd66cd1bf89a65c (diff) | |
download | gps-2c71ec9e02ea234106d520717fc36eb4f3ad7c48.tar.gz |
feat: Add timeuncNs in PQWM1 message
Add timeuncNs field in PQWM1 of debug NMEA
message generated by modem. SystemStaus to
parse it. GnssDebug adds this value in
timeunc when it generates GNSS debug report.
Change-Id: I649915f95730dc8db22e8b4cb88008edc6d8b9d0
CRs-Fixed: 2236950
Diffstat (limited to 'gnss')
-rw-r--r-- | gnss/GnssAdapter.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 5253a1b..1a6bdd9 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -4340,9 +4340,18 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r) (int64_t)(reports.mTimeAndClock.back().mLeapSeconds))*1000ULL + (int64_t)(reports.mTimeAndClock.back().mGpsTowMs); - r.mTime.timeUncertaintyNs = - ((float)(reports.mTimeAndClock.back().mTimeUnc) + - (float)(reports.mTimeAndClock.back().mLeapSecUnc))*1000.0f; + if (reports.mTimeAndClock.back().mTimeUncNs > 0) { + // TimeUncNs value is available + r.mTime.timeUncertaintyNs = + (float)(reports.mTimeAndClock.back().mLeapSecUnc)*1000.0f + + (float)(reports.mTimeAndClock.back().mTimeUncNs); + } else { + // fall back to legacy TimeUnc + r.mTime.timeUncertaintyNs = + ((float)(reports.mTimeAndClock.back().mTimeUnc) + + (float)(reports.mTimeAndClock.back().mLeapSecUnc))*1000.0f; + } + r.mTime.frequencyUncertaintyNsPerSec = (float)(reports.mTimeAndClock.back().mClockFreqBiasUnc); LOC_LOGV("getDebugReport - timeestimate=%" PRIu64 " unc=%f frequnc=%f", |