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 /core | |
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 'core')
-rw-r--r-- | core/SystemStatus.cpp | 19 | ||||
-rw-r--r-- | core/SystemStatus.h | 4 |
2 files changed, 17 insertions, 6 deletions
diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 6ef4993..524963b 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -126,6 +126,7 @@ public: uint32_t mBdsBpAmpQ; // x1C uint32_t mGalBpAmpI; // x1D uint32_t mGalBpAmpQ; // x1E + uint64_t mTimeUncNs; // x1F }; // parser @@ -157,7 +158,6 @@ private: eAgcGlo = 20, eAgcBds = 21, eAgcGal = 22, - eMax0 = eAgcGal, eLeapSeconds = 23, eLeapSecUnc = 24, eGloBpAmpI = 25, @@ -166,6 +166,8 @@ private: eBdsBpAmpQ = 28, eGalBpAmpI = 29, eGalBpAmpQ = 30, + eMax0 = eGalBpAmpQ, + eTimeUncNs = 31, eMax }; SystemStatusPQWM1 mM1; @@ -201,6 +203,7 @@ public: inline uint32_t getBdsBpAmpQ() { return mM1.mBdsBpAmpQ; } inline uint32_t getGalBpAmpI() { return mM1.mGalBpAmpI; } inline uint32_t getGalBpAmpQ() { return mM1.mGalBpAmpQ; } + inline uint64_t getTimeUncNs() { return mM1.mTimeUncNs; } SystemStatusPQWM1parser(const char *str_in, uint32_t len_in) : SystemStatusNmeaBase(str_in, len_in) @@ -245,6 +248,9 @@ public: mM1.mGalBpAmpI = atoi(mField[eGalBpAmpI].c_str()); mM1.mGalBpAmpQ = atoi(mField[eGalBpAmpQ].c_str()); } + if (mField.size() > eTimeUncNs) { + mM1.mTimeUncNs = strtoull(mField[eTimeUncNs].c_str(), nullptr, 10); + } } inline SystemStatusPQWM1& get() { return mM1;} //getparser @@ -715,7 +721,8 @@ SystemStatusTimeAndClock::SystemStatusTimeAndClock(const SystemStatusPQWM1& nmea mClockFreqBias(nmea.mClockFreqBias), mClockFreqBiasUnc(nmea.mClockFreqBiasUnc), mLeapSeconds(nmea.mLeapSeconds), - mLeapSecUnc(nmea.mLeapSecUnc) + mLeapSecUnc(nmea.mLeapSecUnc), + mTimeUncNs(nmea.mTimeUncNs) { } @@ -729,7 +736,8 @@ bool SystemStatusTimeAndClock::equals(const SystemStatusTimeAndClock& peer) (mClockFreqBias != peer.mClockFreqBias) || (mClockFreqBiasUnc != peer.mClockFreqBiasUnc) || (mLeapSeconds != peer.mLeapSeconds) || - (mLeapSecUnc != peer.mLeapSecUnc)) { + (mLeapSecUnc != peer.mLeapSecUnc) || + (mTimeUncNs != peer.mTimeUncNs)) { return false; } return true; @@ -737,7 +745,7 @@ bool SystemStatusTimeAndClock::equals(const SystemStatusTimeAndClock& peer) void SystemStatusTimeAndClock::dump() { - LOC_LOGV("TimeAndClock: u=%ld:%ld g=%d:%d v=%d ts=%d tu=%d b=%d bu=%d ls=%d lu=%d", + LOC_LOGV("TimeAndClock: u=%ld:%ld g=%d:%d v=%d ts=%d tu=%d b=%d bu=%d ls=%d lu=%d un=%" PRIu64, mUtcTime.tv_sec, mUtcTime.tv_nsec, mGpsWeek, mGpsTowMs, @@ -747,7 +755,8 @@ void SystemStatusTimeAndClock::dump() mClockFreqBias, mClockFreqBiasUnc, mLeapSeconds, - mLeapSecUnc); + mLeapSecUnc, + mTimeUncNs); return; } diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 73a220a..399a6c4 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -116,6 +116,7 @@ public: int32_t mClockFreqBiasUnc; int32_t mLeapSeconds; int32_t mLeapSecUnc; + uint64_t mTimeUncNs; inline SystemStatusTimeAndClock() : mGpsWeek(0), mGpsTowMs(0), @@ -125,7 +126,8 @@ public: mClockFreqBias(0), mClockFreqBiasUnc(0), mLeapSeconds(0), - mLeapSecUnc(0) {} + mLeapSecUnc(0), + mTimeUncNs(0ULL) {} inline SystemStatusTimeAndClock(const SystemStatusPQWM1& nmea); bool equals(const SystemStatusTimeAndClock& peer); void dump(void); |