summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorSaurabh Srivastava <ssrivast@codeaurora.org>2019-09-06 17:50:56 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2019-09-09 22:06:54 -0700
commit92ba006e1b419b29b08d350f0fa7c3ea78fd2b68 (patch)
treeaff9b705528303dc3585acb1d03b35134e2c314b /core
parentf4dc944333c54a5455d17b6bd7c02d2ededb6e4a (diff)
downloadgps-92ba006e1b419b29b08d350f0fa7c3ea78fd2b68.tar.gz
Support PQWP7 parsing without NAVIC
Support PQWP7 NMEA parsing for older GNSS engine without NAVIC support. CRs-Fixed: 2516292 Change-Id: I62bd4467f15b8c5fc77e7c979eefb146276ff2a0
Diffstat (limited to 'core')
-rw-r--r--core/SystemStatus.cpp12
-rw-r--r--core/SystemStatus.h3
2 files changed, 12 insertions, 3 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());
diff --git a/core/SystemStatus.h b/core/SystemStatus.h
index d119a1c..2cfb25d 100644
--- a/core/SystemStatus.h
+++ b/core/SystemStatus.h
@@ -59,7 +59,8 @@
#define BDS_NUM (37)
#define GAL_NUM (36)
#define NAVIC_NUM (14)
-#define SV_ALL_NUM (GPS_NUM+GLO_NUM+QZSS_NUM+BDS_NUM+GAL_NUM+NAVIC_NUM) //=148
+#define SV_ALL_NUM_MIN (GPS_NUM + GLO_NUM + QZSS_NUM + BDS_NUM + GAL_NUM) //=134
+#define SV_ALL_NUM (SV_ALL_NUM_MIN + NAVIC_NUM) //=148
namespace loc_core
{