diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2018-08-21 14:29:46 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-08-21 14:29:45 -0700 |
commit | 3379b6645dde46d7621b2068e043d636b2dab6c3 (patch) | |
tree | 22e3ebf1e6248a6057e5d126a63bb4be0f206e71 /core/LocApiBase.cpp | |
parent | a190b2c1164a60a2350b5ed53fa4ef3e2d7e7689 (diff) | |
parent | 75cfd43bfdab4fb478e1504808a418320f5dcd95 (diff) | |
download | gps-3379b6645dde46d7621b2068e043d636b2dab6c3.tar.gz |
Merge "Add jammer indication"
Diffstat (limited to 'core/LocApiBase.cpp')
-rw-r--r-- | core/LocApiBase.cpp | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index dd52ab6..f44ab45 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -240,6 +240,30 @@ void LocApiBase::updateEvtMask() mMsgTask->sendMsg(new LocOpenMsg(this)); } +void LocApiBase::updateNmeaMask(uint32_t mask) +{ + struct LocSetNmeaMsg : public LocMsg { + LocApiBase* mLocApi; + uint32_t mMask; + inline LocSetNmeaMsg(LocApiBase* locApi, uint32_t mask) : + LocMsg(), mLocApi(locApi), mMask(mask) + { + locallog(); + } + inline virtual void proc() const { + mLocApi->setNMEATypesSync(mMask); + } + inline void locallog() const { + LOC_LOGv("LocSyncNmea NmeaMask: %" PRIx32 "\n", mMask); + } + inline virtual void log() const { + locallog(); + } + }; + + mMsgTask->sendMsg(new LocSetNmeaMsg(this, mask)); +} + void LocApiBase::handleEngineUpEvent() { LocDualContext::injectFeatureConfig(mContext); @@ -259,7 +283,9 @@ void LocApiBase::handleEngineDownEvent() void LocApiBase::reportPosition(UlpLocation& location, GpsLocationExtended& locationExtended, enum loc_sess_status status, - LocPosTechMask loc_technology_mask) + LocPosTechMask loc_technology_mask, + GnssDataNotification* pDataNotify, + int msInWeek) { // print the location info before delivering LOC_LOGD("flags: %d\n source: %d\n latitude: %f\n longitude: %f\n " @@ -281,7 +307,9 @@ void LocApiBase::reportPosition(UlpLocation& location, // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS( mLocAdapters[i]->reportPositionEvent(location, locationExtended, - status, loc_technology_mask) + status, loc_technology_mask, + false, + pDataNotify, msInWeek) ); } @@ -363,6 +391,12 @@ void LocApiBase::reportStatus(LocGpsStatusValue status) TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportStatus(status)); } +void LocApiBase::reportData(GnssDataNotification& dataNotify, int msInWeek) +{ + // loop through adapters, and deliver to all adapters. + TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportDataEvent(dataNotify, msInWeek)); +} + void LocApiBase::reportNmea(const char* nmea, int length) { // loop through adapters, and deliver to all adapters. |