diff options
author | Kevin Tang <quic_zhikait@quicinc.com> | 2019-09-10 15:06:01 -0700 |
---|---|---|
committer | Wayne Lin <waynewhlin@google.com> | 2019-10-02 12:23:41 +0800 |
commit | 5aa8de4a0f30c9507de5fcdab29caeb962356c1a (patch) | |
tree | ec3216c9aa23a029d3355d2f6a9f7049246f9fe4 /core/SystemStatus.cpp | |
parent | 6c4d159942ff43c743759a0ec7ced6190504e217 (diff) | |
download | gps-5aa8de4a0f30c9507de5fcdab29caeb962356c1a.tar.gz |
Support PQWP7 parsing without NAVIC
Support PQWP7 NMEA parsing for older
GNSS engine without NAVIC support.
Bug:141735605
Test: build pass and no PQWP7 error when tracking
CRs-Fixed: 2516292
Change-Id: I62bd4467f15b8c5fc77e7c979eefb146276ff2a0
Diffstat (limited to 'core/SystemStatus.cpp')
-rw-r--r-- | core/SystemStatus.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 9ca126f..7d76651 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -660,6 +660,7 @@ private: { eTalker = 0, eUtcTime = 1, + eMin = 2 + SV_ALL_NUM_MIN*3, eMax = 2 + SV_ALL_NUM*3 }; SystemStatusPQWP7 mP7; @@ -668,11 +669,18 @@ public: SystemStatusPQWP7parser(const char *str_in, uint32_t len_in) : SystemStatusNmeaBase(str_in, len_in) { - if (mField.size() < eMax) { + uint32_t svLimit = SV_ALL_NUM; + if (mField.size() < eMin) { LOC_LOGE("PQWP7parser - invalid size=%zu", mField.size()); return; } - for (uint32_t i=0; i<SV_ALL_NUM; i++) { + if (mField.size() < eMax) { + // Try reducing limit, accounting for possibly missing NAVIC support + svLimit = SV_ALL_NUM_MIN; + } + + memset(mP7.mNav, 0, sizeof(mP7.mNav)); + for (uint32_t i=0; i<svLimit; i++) { mP7.mNav[i].mType = GnssEphemerisType(atoi(mField[i*3+2].c_str())); mP7.mNav[i].mSource = GnssEphemerisSource(atoi(mField[i*3+3].c_str())); mP7.mNav[i].mAgeSec = atoi(mField[i*3+4].c_str()); |