Home | History | Annotate | Download | only in core
      1 /* Copyright (c) 2017, The Linux Foundation. All rights reserved.
      2  *
      3  * Redistribution and use in source and binary forms, with or without
      4  * modification, are permitted provided that the following conditions are
      5  * met:
      6  *     * Redistributions of source code must retain the above copyright
      7  *       notice, this list of conditions and the following disclaimer.
      8  *     * Redistributions in binary form must reproduce the above
      9  *       copyright notice, this list of conditions and the following
     10  *       disclaimer in the documentation and/or other materials provided
     11  *       with the distribution.
     12  *     * Neither the name of The Linux Foundation, nor the names of its
     13  *       contributors may be used to endorse or promote products derived
     14  *       from this software without specific prior written permission.
     15  *
     16  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
     17  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
     19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
     20  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
     23  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     24  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
     25  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
     26  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     27  *
     28  */
     29 #ifndef __SYSTEM_STATUS__
     30 #define __SYSTEM_STATUS__
     31 
     32 #include <stdint.h>
     33 #include <string>
     34 #include <vector>
     35 #include <platform_lib_log_util.h>
     36 #include <MsgTask.h>
     37 #include <IDataItemCore.h>
     38 #include <IOsObserver.h>
     39 #include <SystemStatusOsObserver.h>
     40 
     41 #include <gps_extended_c.h>
     42 
     43 #define GPS_MIN  (1)   //1-32
     44 #define SBAS_MIN (33)
     45 #define GLO_MIN  (65)  //65-88
     46 #define QZSS_MIN (193) //193-197
     47 #define BDS_MIN  (201) //201-237
     48 #define GAL_MIN  (301) //301-336
     49 
     50 #define GPS_NUM  (32)
     51 #define SBAS_NUM (32)
     52 #define GLO_NUM  (24)
     53 #define QZSS_NUM (5)
     54 #define BDS_NUM  (37)
     55 #define GAL_NUM  (36)
     56 #define SV_ALL_NUM  (GPS_NUM+GLO_NUM+QZSS_NUM+BDS_NUM+GAL_NUM) //=134
     57 
     58 namespace loc_core
     59 {
     60 
     61 /******************************************************************************
     62  SystemStatus report data structure
     63 ******************************************************************************/
     64 class SystemStatusItemBase
     65 {
     66 public:
     67     timespec mUtcTime;     // UTC timestamp when this info was last updated
     68     timespec mUtcReported; // UTC timestamp when this info was reported
     69 
     70     SystemStatusItemBase() {
     71         timeval tv;
     72         gettimeofday(&tv, NULL);
     73         mUtcTime.tv_sec  = tv.tv_sec;
     74         mUtcTime.tv_nsec = tv.tv_usec *1000ULL;
     75         mUtcReported = mUtcTime;
     76     };
     77     virtual ~SystemStatusItemBase() { };
     78     virtual void dump(void) { };
     79 };
     80 
     81 class SystemStatusLocation : public SystemStatusItemBase
     82 {
     83 public:
     84     bool mValid;
     85     UlpLocation mLocation;
     86     GpsLocationExtended mLocationEx;
     87     inline SystemStatusLocation() :
     88         mValid(false) {}
     89     inline SystemStatusLocation(const UlpLocation& location,
     90                          const GpsLocationExtended& locationEx) :
     91         mValid(true),
     92         mLocation(location),
     93         mLocationEx(locationEx) { }
     94     bool equals(SystemStatusLocation& peer);
     95     void dump(void);
     96 };
     97 
     98 class SystemStatusPQWM1;
     99 class SystemStatusTimeAndClock : public SystemStatusItemBase
    100 {
    101 public:
    102     uint16_t mGpsWeek;
    103     uint32_t mGpsTowMs;
    104     uint8_t  mTimeValid;
    105     uint8_t  mTimeSource;
    106     int32_t  mTimeUnc;
    107     int32_t  mClockFreqBias;
    108     int32_t  mClockFreqBiasUnc;
    109     int32_t  mLeapSeconds;
    110     int32_t  mLeapSecUnc;
    111     inline SystemStatusTimeAndClock() :
    112         mGpsWeek(0),
    113         mGpsTowMs(0),
    114         mTimeValid(0),
    115         mTimeSource(0),
    116         mTimeUnc(0),
    117         mClockFreqBias(0),
    118         mClockFreqBiasUnc(0),
    119         mLeapSeconds(0),
    120         mLeapSecUnc(0) {}
    121     inline SystemStatusTimeAndClock(const SystemStatusPQWM1& nmea);
    122     bool equals(SystemStatusTimeAndClock& peer);
    123     void dump(void);
    124 };
    125 
    126 class SystemStatusXoState : public SystemStatusItemBase
    127 {
    128 public:
    129     uint8_t  mXoState;
    130     inline SystemStatusXoState() :
    131         mXoState(0) {}
    132     inline SystemStatusXoState(const SystemStatusPQWM1& nmea);
    133     bool equals(SystemStatusXoState& peer);
    134     void dump(void);
    135 };
    136 
    137 class SystemStatusRfAndParams : public SystemStatusItemBase
    138 {
    139 public:
    140     int32_t  mPgaGain;
    141     uint32_t mGpsBpAmpI;
    142     uint32_t mGpsBpAmpQ;
    143     uint32_t mAdcI;
    144     uint32_t mAdcQ;
    145     uint32_t mJammerGps;
    146     uint32_t mJammerGlo;
    147     uint32_t mJammerBds;
    148     uint32_t mJammerGal;
    149     double   mAgcGps;
    150     double   mAgcGlo;
    151     double   mAgcBds;
    152     double   mAgcGal;
    153     inline SystemStatusRfAndParams() :
    154         mPgaGain(0),
    155         mGpsBpAmpI(0),
    156         mGpsBpAmpQ(0),
    157         mAdcI(0),
    158         mAdcQ(0),
    159         mJammerGps(0),
    160         mJammerGlo(0),
    161         mJammerBds(0),
    162         mJammerGal(0),
    163         mAgcGps(0),
    164         mAgcGlo(0),
    165         mAgcBds(0),
    166         mAgcGal(0) {}
    167     inline SystemStatusRfAndParams(const SystemStatusPQWM1& nmea);
    168     bool equals(SystemStatusRfAndParams& peer);
    169     void dump(void);
    170 };
    171 
    172 class SystemStatusErrRecovery : public SystemStatusItemBase
    173 {
    174 public:
    175     uint32_t mRecErrorRecovery;
    176     inline SystemStatusErrRecovery() :
    177         mRecErrorRecovery(0) {};
    178     inline SystemStatusErrRecovery(const SystemStatusPQWM1& nmea);
    179     bool equals(SystemStatusErrRecovery& peer);
    180     void dump(void);
    181 };
    182 
    183 class SystemStatusPQWP1;
    184 class SystemStatusInjectedPosition : public SystemStatusItemBase
    185 {
    186 public:
    187     uint8_t  mEpiValidity;
    188     float    mEpiLat;
    189     float    mEpiLon;
    190     float    mEpiAlt;
    191     float    mEpiHepe;
    192     float    mEpiAltUnc;
    193     uint8_t  mEpiSrc;
    194     inline SystemStatusInjectedPosition() :
    195         mEpiValidity(0),
    196         mEpiLat(0),
    197         mEpiLon(0),
    198         mEpiAlt(0),
    199         mEpiHepe(0),
    200         mEpiAltUnc(0),
    201         mEpiSrc(0) {}
    202     inline SystemStatusInjectedPosition(const SystemStatusPQWP1& nmea);
    203     bool equals(SystemStatusInjectedPosition& peer);
    204     void dump(void);
    205 };
    206 
    207 class SystemStatusPQWP2;
    208 class SystemStatusBestPosition : public SystemStatusItemBase
    209 {
    210 public:
    211     bool     mValid;
    212     float    mBestLat;
    213     float    mBestLon;
    214     float    mBestAlt;
    215     float    mBestHepe;
    216     float    mBestAltUnc;
    217     inline SystemStatusBestPosition() :
    218         mValid(false),
    219         mBestLat(0),
    220         mBestLon(0),
    221         mBestAlt(0),
    222         mBestHepe(0),
    223         mBestAltUnc(0) {}
    224     inline SystemStatusBestPosition(const SystemStatusPQWP2& nmea);
    225     bool equals(SystemStatusBestPosition& peer);
    226     void dump(void);
    227 };
    228 
    229 class SystemStatusPQWP3;
    230 class SystemStatusXtra : public SystemStatusItemBase
    231 {
    232 public:
    233     uint8_t   mXtraValidMask;
    234     uint32_t  mGpsXtraAge;
    235     uint32_t  mGloXtraAge;
    236     uint32_t  mBdsXtraAge;
    237     uint32_t  mGalXtraAge;
    238     uint32_t  mQzssXtraAge;
    239     uint32_t  mGpsXtraValid;
    240     uint32_t  mGloXtraValid;
    241     uint64_t  mBdsXtraValid;
    242     uint64_t  mGalXtraValid;
    243     uint8_t   mQzssXtraValid;
    244     inline SystemStatusXtra() :
    245         mXtraValidMask(0),
    246         mGpsXtraAge(0),
    247         mGloXtraAge(0),
    248         mBdsXtraAge(0),
    249         mGalXtraAge(0),
    250         mQzssXtraAge(0),
    251         mGpsXtraValid(0),
    252         mGloXtraValid(0),
    253         mBdsXtraValid(0ULL),
    254         mGalXtraValid(0ULL),
    255         mQzssXtraValid(0) {}
    256     inline SystemStatusXtra(const SystemStatusPQWP3& nmea);
    257     bool equals(SystemStatusXtra& peer);
    258     void dump(void);
    259 };
    260 
    261 class SystemStatusPQWP4;
    262 class SystemStatusEphemeris : public SystemStatusItemBase
    263 {
    264 public:
    265     uint32_t  mGpsEpheValid;
    266     uint32_t  mGloEpheValid;
    267     uint64_t  mBdsEpheValid;
    268     uint64_t  mGalEpheValid;
    269     uint8_t   mQzssEpheValid;
    270     inline SystemStatusEphemeris() :
    271         mGpsEpheValid(0),
    272         mGloEpheValid(0),
    273         mBdsEpheValid(0ULL),
    274         mGalEpheValid(0ULL),
    275         mQzssEpheValid(0) {}
    276     inline SystemStatusEphemeris(const SystemStatusPQWP4& nmea);
    277     bool equals(SystemStatusEphemeris& peer);
    278     void dump(void);
    279 };
    280 
    281 class SystemStatusPQWP5;
    282 class SystemStatusSvHealth : public SystemStatusItemBase
    283 {
    284 public:
    285     uint32_t  mGpsUnknownMask;
    286     uint32_t  mGloUnknownMask;
    287     uint64_t  mBdsUnknownMask;
    288     uint64_t  mGalUnknownMask;
    289     uint8_t   mQzssUnknownMask;
    290     uint32_t  mGpsGoodMask;
    291     uint32_t  mGloGoodMask;
    292     uint64_t  mBdsGoodMask;
    293     uint64_t  mGalGoodMask;
    294     uint8_t   mQzssGoodMask;
    295     uint32_t  mGpsBadMask;
    296     uint32_t  mGloBadMask;
    297     uint64_t  mBdsBadMask;
    298     uint64_t  mGalBadMask;
    299     uint8_t   mQzssBadMask;
    300     inline SystemStatusSvHealth() :
    301         mGpsUnknownMask(0),
    302         mGloUnknownMask(0),
    303         mBdsUnknownMask(0ULL),
    304         mGalUnknownMask(0ULL),
    305         mQzssUnknownMask(0),
    306         mGpsGoodMask(0),
    307         mGloGoodMask(0),
    308         mBdsGoodMask(0ULL),
    309         mGalGoodMask(0ULL),
    310         mQzssGoodMask(0),
    311         mGpsBadMask(0),
    312         mGloBadMask(0),
    313         mBdsBadMask(0ULL),
    314         mGalBadMask(0ULL),
    315         mQzssBadMask(0) {}
    316     inline SystemStatusSvHealth(const SystemStatusPQWP5& nmea);
    317     bool equals(SystemStatusSvHealth& peer);
    318     void dump(void);
    319 };
    320 
    321 class SystemStatusPQWP6;
    322 class SystemStatusPdr : public SystemStatusItemBase
    323 {
    324 public:
    325     uint32_t  mFixInfoMask;
    326     inline SystemStatusPdr() :
    327         mFixInfoMask(0) {}
    328     inline SystemStatusPdr(const SystemStatusPQWP6& nmea);
    329     bool equals(SystemStatusPdr& peer);
    330     void dump(void);
    331 };
    332 
    333 class SystemStatusPQWP7;
    334 struct SystemStatusNav
    335 {
    336     GnssEphemerisType   mType;
    337     GnssEphemerisSource mSource;
    338     int32_t             mAgeSec;
    339 };
    340 
    341 class SystemStatusNavData : public SystemStatusItemBase
    342 {
    343 public:
    344     SystemStatusNav mNav[SV_ALL_NUM];
    345     inline SystemStatusNavData() {
    346         for (uint32_t i=0; i<SV_ALL_NUM; i++) {
    347             mNav[i].mType = GNSS_EPH_TYPE_UNKNOWN;
    348             mNav[i].mSource = GNSS_EPH_SOURCE_UNKNOWN;
    349             mNav[i].mAgeSec = 0;
    350         }
    351     }
    352     inline SystemStatusNavData(const SystemStatusPQWP7& nmea);
    353     bool equals(SystemStatusNavData& peer);
    354     void dump(void);
    355 };
    356 
    357 class SystemStatusPQWS1;
    358 class SystemStatusPositionFailure : public SystemStatusItemBase
    359 {
    360 public:
    361     uint32_t  mFixInfoMask;
    362     uint32_t  mHepeLimit;
    363     inline SystemStatusPositionFailure() :
    364         mFixInfoMask(0),
    365         mHepeLimit(0) {}
    366     inline SystemStatusPositionFailure(const SystemStatusPQWS1& nmea);
    367     bool equals(SystemStatusPositionFailure& peer);
    368     void dump(void);
    369 };
    370 
    371 /******************************************************************************
    372  SystemStatus report data structure - from DataItem observer
    373 ******************************************************************************/
    374 class SystemStatusGpsState : public SystemStatusItemBase, public IDataItemCore
    375 {
    376 public:
    377     inline SystemStatusGpsState() :
    378             mEnabled(false) {}
    379     inline SystemStatusGpsState(bool enabled) :
    380             mEnabled(enabled) {}
    381 
    382     bool mEnabled;
    383 
    384     inline bool equals(SystemStatusGpsState& peer) {
    385         return (mEnabled == peer.mEnabled);
    386     }
    387     inline void dump(void) {
    388         LOC_LOGD("GpsState: state=%u", mEnabled);
    389     }
    390     inline DataItemId getId() {
    391         return GPSSTATE_DATA_ITEM_ID;
    392     }
    393     inline void stringify(string& valueStr) {
    394         valueStr.clear();
    395         valueStr += "GpsState: enabled=";
    396         valueStr += to_string(mEnabled);
    397     }
    398     inline int32_t copy(IDataItemCore* src, bool* dataItemCopied = nullptr) {
    399         SystemStatusGpsState* gpsstate = static_cast<SystemStatusGpsState*>(src);
    400         mEnabled = gpsstate->mEnabled;
    401         if (dataItemCopied) {
    402             *dataItemCopied = true;
    403         }
    404         return 1;
    405     }
    406 };
    407 
    408 class SystemStatusNetworkInfo : public SystemStatusItemBase, public IDataItemCore
    409 {
    410 public:
    411     inline SystemStatusNetworkInfo() :
    412             mType(0),
    413             mTypeName(""),
    414             mSubTypeName(""),
    415             mAvailable(false),
    416             mConnected(false),
    417             mRoaming(false) {}
    418     inline SystemStatusNetworkInfo(
    419             uint32_t type,
    420             std::string typeName,
    421             std::string subTypeName,
    422             bool available,
    423             bool connected,
    424             bool roaming) :
    425             mType(type),
    426             mTypeName(typeName),
    427             mSubTypeName(subTypeName),
    428             mAvailable(available),
    429             mConnected(connected),
    430             mRoaming(roaming) {}
    431 
    432     uint32_t mType;
    433     std::string mTypeName;
    434     std::string mSubTypeName;
    435     bool mAvailable;
    436     bool mConnected;
    437     bool mRoaming;
    438 
    439     inline bool equals(SystemStatusNetworkInfo& peer) {
    440         if ((mType != peer.mType) ||
    441             (mTypeName != peer.mTypeName) ||
    442             (mSubTypeName != peer.mSubTypeName) ||
    443             (mAvailable != peer.mAvailable) ||
    444             (mConnected != peer.mConnected) ||
    445             (mRoaming != peer.mRoaming)) {
    446             return false;
    447         }
    448         return true;
    449     }
    450     inline void dump(void) {
    451         LOC_LOGD("NetworkInfo: type=%u connected=%u", mType, mConnected);
    452     }
    453     inline DataItemId getId() {
    454         return NETWORKINFO_DATA_ITEM_ID;
    455     }
    456     inline void stringify(string& /*valueStr*/) { }
    457     inline int32_t copy(IDataItemCore* src, bool* dataItemCopied = nullptr) {
    458         SystemStatusNetworkInfo* networkinfo = static_cast<SystemStatusNetworkInfo*>(src);
    459         mType = networkinfo->mType;
    460         mTypeName = networkinfo->mTypeName;
    461         mSubTypeName = networkinfo->mSubTypeName;
    462         mAvailable = networkinfo->mAvailable;
    463         mConnected = networkinfo->mConnected;
    464         mRoaming = networkinfo->mRoaming;
    465         if (dataItemCopied) {
    466             *dataItemCopied = true;
    467         }
    468         return 1;
    469     }
    470 };
    471 
    472 class SystemStatusTac : public SystemStatusItemBase, public IDataItemCore
    473 {
    474 public:
    475     inline SystemStatusTac() :
    476             mValue("") {}
    477     inline SystemStatusTac(std::string value) :
    478             mValue(value) {}
    479 
    480     std::string mValue;
    481 
    482     inline bool equals(SystemStatusTac& peer) {
    483         return (mValue == peer.mValue);
    484     }
    485     inline void dump(void) {
    486         LOC_LOGD("Tac: value=%s", mValue.c_str());
    487     }
    488     inline DataItemId getId() {
    489         return TAC_DATA_ITEM_ID;
    490     }
    491     inline void stringify(string& /*valueStr*/) { }
    492     inline int32_t copy(IDataItemCore* src, bool* dataItemCopied = nullptr) {
    493         SystemStatusTac* tac = static_cast<SystemStatusTac*>(src);
    494         mValue = tac->mValue;
    495         if (dataItemCopied) {
    496             *dataItemCopied = true;
    497         }
    498         return 1;
    499     }
    500 };
    501 
    502 class SystemStatusMccMnc : public SystemStatusItemBase, public IDataItemCore
    503 {
    504 public:
    505     inline SystemStatusMccMnc() :
    506             mValue("") {}
    507     inline SystemStatusMccMnc(std::string value) :
    508             mValue(value) {}
    509 
    510     std::string mValue;
    511 
    512     inline bool equals(SystemStatusMccMnc& peer) {
    513         return (mValue == peer.mValue);
    514     }
    515     inline void dump(void) {
    516         LOC_LOGD("TacMccMnc value=%s", mValue.c_str());
    517     }
    518     inline DataItemId getId() {
    519         return MCCMNC_DATA_ITEM_ID;
    520     }
    521     inline void stringify(string& /*valueStr*/) { }
    522     inline int32_t copy(IDataItemCore* src, bool* dataItemCopied = nullptr) {
    523         SystemStatusMccMnc* mccmnc = static_cast<SystemStatusMccMnc*>(src);
    524         mValue = mccmnc->mValue;
    525         if (dataItemCopied) {
    526             *dataItemCopied = true;
    527         }
    528         return 1;
    529     }
    530 };
    531 
    532 /******************************************************************************
    533  SystemStatusReports
    534 ******************************************************************************/
    535 class SystemStatusReports
    536 {
    537 public:
    538     // from QMI_LOC indication
    539     std::vector<SystemStatusLocation>         mLocation;
    540 
    541     // from ME debug NMEA
    542     std::vector<SystemStatusTimeAndClock>     mTimeAndClock;
    543     std::vector<SystemStatusXoState>          mXoState;
    544     std::vector<SystemStatusRfAndParams>      mRfAndParams;
    545     std::vector<SystemStatusErrRecovery>      mErrRecovery;
    546 
    547     // from PE debug NMEA
    548     std::vector<SystemStatusInjectedPosition> mInjectedPosition;
    549     std::vector<SystemStatusBestPosition>     mBestPosition;
    550     std::vector<SystemStatusXtra>             mXtra;
    551     std::vector<SystemStatusEphemeris>        mEphemeris;
    552     std::vector<SystemStatusSvHealth>         mSvHealth;
    553     std::vector<SystemStatusPdr>              mPdr;
    554     std::vector<SystemStatusNavData>          mNavData;
    555 
    556     // from SM debug NMEA
    557     std::vector<SystemStatusPositionFailure>  mPositionFailure;
    558 
    559     // from dataitems observer
    560     std::vector<SystemStatusGpsState>         mGpsState;
    561     std::vector<SystemStatusNetworkInfo>      mNetworkInfo;
    562     std::vector<SystemStatusTac>              mTac;
    563     std::vector<SystemStatusMccMnc>           mMccMnc;
    564 };
    565 
    566 /******************************************************************************
    567  SystemStatus
    568 ******************************************************************************/
    569 class SystemStatus
    570 {
    571 private:
    572     static SystemStatus                       *mInstance;
    573     SystemStatusOsObserver                    mSysStatusObsvr;
    574     // ctor
    575     SystemStatus(const MsgTask* msgTask);
    576     // dtor
    577     inline ~SystemStatus() {}
    578 
    579     // Data members
    580     static pthread_mutex_t                    mMutexSystemStatus;
    581 
    582     static const uint32_t                     maxLocation = 5;
    583 
    584     static const uint32_t                     maxTimeAndClock = 5;
    585     static const uint32_t                     maxXoState = 5;
    586     static const uint32_t                     maxRfAndParams = 5;
    587     static const uint32_t                     maxErrRecovery = 5;
    588 
    589     static const uint32_t                     maxInjectedPosition = 5;
    590     static const uint32_t                     maxBestPosition = 5;
    591     static const uint32_t                     maxXtra = 5;
    592     static const uint32_t                     maxEphemeris = 5;
    593     static const uint32_t                     maxSvHealth = 5;
    594     static const uint32_t                     maxPdr = 5;
    595     static const uint32_t                     maxNavData = 5;
    596 
    597     static const uint32_t                     maxPositionFailure = 5;
    598 
    599     static const uint32_t                     maxGpsState = 5;
    600     static const uint32_t                     maxNetworkInfo = 5;
    601     static const uint32_t                     maxTac = 5;
    602     static const uint32_t                     maxMccMnc = 5;
    603 
    604     SystemStatusReports mCache;
    605     bool mConnected;
    606 
    607     bool setLocation(const UlpLocation& location);
    608 
    609     bool setTimeAndCLock(const SystemStatusPQWM1& nmea);
    610     bool setXoState(const SystemStatusPQWM1& nmea);
    611     bool setRfAndParams(const SystemStatusPQWM1& nmea);
    612     bool setErrRecovery(const SystemStatusPQWM1& nmea);
    613 
    614     bool setInjectedPosition(const SystemStatusPQWP1& nmea);
    615     bool setBestPosition(const SystemStatusPQWP2& nmea);
    616     bool setXtra(const SystemStatusPQWP3& nmea);
    617     bool setEphemeris(const SystemStatusPQWP4& nmea);
    618     bool setSvHealth(const SystemStatusPQWP5& nmea);
    619     bool setPdr(const SystemStatusPQWP6& nmea);
    620     bool setNavData(const SystemStatusPQWP7& nmea);
    621 
    622     bool setPositionFailure(const SystemStatusPQWS1& nmea);
    623 
    624     bool setNetworkInfo(IDataItemCore* dataitem);
    625 
    626 public:
    627     // Static methods
    628     static SystemStatus* getInstance(const MsgTask* msgTask);
    629     static void destroyInstance();
    630     IOsObserver* getOsObserver();
    631 
    632     // Helpers
    633     bool eventPosition(const UlpLocation& location,const GpsLocationExtended& locationEx);
    634     bool eventDataItemNotify(IDataItemCore* dataitem);
    635     bool setNmeaString(const char *data, uint32_t len);
    636     bool getReport(SystemStatusReports& reports, bool isLatestonly = false) const;
    637     bool setDefaultReport(void);
    638     bool eventConnectionStatus(bool connected, uint8_t type);
    639 };
    640 
    641 } // namespace loc_core
    642 
    643 #endif //__SYSTEM_STATUS__
    644 
    645