diff options
author | Katz Yamada <kyamada@codeaurora.org> | 2018-08-02 15:31:28 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-08-08 20:42:19 -0700 |
commit | 8a752aa1b37af0cc12a975ed1f0f3eb69a3984b4 (patch) | |
tree | fe8e115970b1573a85303a5f3af61e6efbe163f1 /core | |
parent | 4bab73548d6c030cb4a30ac07b068b35e0553af4 (diff) | |
download | gps-8a752aa1b37af0cc12a975ed1f0f3eb69a3984b4.tar.gz |
Systemsatus - add support older version of PQWME
Add support of older (shorter) version of PQWME
strings from modem. Systemstatus currently discards
those shorter strings. This change is to fill out
all zeros in those missing fields instead of
discarding the whole sentence.
Change-Id: I31c42b6de53c3002f598cfd815304086bba056f9
CRs-Fixed: 2153513
Diffstat (limited to 'core')
-rw-r--r-- | core/SystemStatus.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index b3260bd..f4316ca 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -157,6 +157,7 @@ private: eAgcGlo = 20, eAgcBds = 21, eAgcGal = 22, + eMax0 = eAgcGal, eLeapSeconds = 23, eLeapSecUnc = 24, eGloBpAmpI = 25, @@ -205,7 +206,7 @@ public: : SystemStatusNmeaBase(str_in, len_in) { memset(&mM1, 0, sizeof(mM1)); - if (mField.size() < eMax) { + if (mField.size() <= eMax0) { LOC_LOGE("PQWM1parser - invalid size=%zu", mField.size()); mM1.mTimeValid = 0; return; @@ -232,14 +233,18 @@ public: mM1.mAgcGlo = atof(mField[eAgcGlo].c_str()); mM1.mAgcBds = atof(mField[eAgcBds].c_str()); mM1.mAgcGal = atof(mField[eAgcGal].c_str()); - mM1.mLeapSeconds = atoi(mField[eLeapSeconds].c_str()); - mM1.mLeapSecUnc = atoi(mField[eLeapSecUnc].c_str()); - mM1.mGloBpAmpI = atoi(mField[eGloBpAmpI].c_str()); - mM1.mGloBpAmpQ = atoi(mField[eGloBpAmpQ].c_str()); - mM1.mBdsBpAmpI = atoi(mField[eBdsBpAmpI].c_str()); - mM1.mBdsBpAmpQ = atoi(mField[eBdsBpAmpQ].c_str()); - mM1.mGalBpAmpI = atoi(mField[eGalBpAmpI].c_str()); - mM1.mGalBpAmpQ = atoi(mField[eGalBpAmpQ].c_str()); + if (mField.size() > eLeapSecUnc) { + mM1.mLeapSeconds = atoi(mField[eLeapSeconds].c_str()); + mM1.mLeapSecUnc = atoi(mField[eLeapSecUnc].c_str()); + } + if (mField.size() > eGalBpAmpQ) { + mM1.mGloBpAmpI = atoi(mField[eGloBpAmpI].c_str()); + mM1.mGloBpAmpQ = atoi(mField[eGloBpAmpQ].c_str()); + mM1.mBdsBpAmpI = atoi(mField[eBdsBpAmpI].c_str()); + mM1.mBdsBpAmpQ = atoi(mField[eBdsBpAmpQ].c_str()); + mM1.mGalBpAmpI = atoi(mField[eGalBpAmpI].c_str()); + mM1.mGalBpAmpQ = atoi(mField[eGalBpAmpQ].c_str()); + } } inline SystemStatusPQWM1& get() { return mM1;} //getparser |