summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2018-08-21 14:29:46 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2018-08-21 14:29:45 -0700
commit3379b6645dde46d7621b2068e043d636b2dab6c3 (patch)
tree22e3ebf1e6248a6057e5d126a63bb4be0f206e71 /core
parenta190b2c1164a60a2350b5ed53fa4ef3e2d7e7689 (diff)
parent75cfd43bfdab4fb478e1504808a418320f5dcd95 (diff)
downloadgps-3379b6645dde46d7621b2068e043d636b2dab6c3.tar.gz
Merge "Add jammer indication"
Diffstat (limited to 'core')
-rw-r--r--core/LocAdapterBase.cpp10
-rw-r--r--core/LocAdapterBase.h10
-rw-r--r--core/LocAdapterProxyBase.h1
-rw-r--r--core/LocApiBase.cpp38
-rw-r--r--core/LocApiBase.h7
5 files changed, 60 insertions, 6 deletions
diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp
index 8301ee8..8197f4d 100644
--- a/core/LocAdapterBase.cpp
+++ b/core/LocAdapterBase.cpp
@@ -80,7 +80,10 @@ void LocAdapterBase::
const GpsLocationExtended& locationExtended,
enum loc_sess_status status,
LocPosTechMask loc_technology_mask,
- bool /*fromEngineHub*/) {
+ bool /*fromEngineHub*/,
+ GnssDataNotification* pDataNotify,
+ int msInWeek)
+{
if (mLocAdapterProxyBase != NULL) {
mLocAdapterProxyBase->reportPositionEvent((UlpLocation&)location,
(GpsLocationExtended&)locationExtended,
@@ -113,6 +116,11 @@ void LocAdapterBase::
reportNmeaEvent(const char* /*nmea*/, size_t /*length*/)
DEFAULT_IMPL()
+void LocAdapterBase::
+ reportDataEvent(const GnssDataNotification& /*dataNotify*/,
+ int /*msInWeek*/)
+DEFAULT_IMPL()
+
bool LocAdapterBase::
reportXtraServer(const char* /*url1*/, const char* /*url2*/,
const char* /*url3*/, const int /*maxlength*/)
diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h
index e3502b2..6b3e02f 100644
--- a/core/LocAdapterBase.h
+++ b/core/LocAdapterBase.h
@@ -113,6 +113,11 @@ public:
mLocApi->updateEvtMask();
}
+ inline void updateNmeaMask(uint32_t mask)
+ {
+ mLocApi->updateNmeaMask(mask);
+ }
+
inline bool isFeatureSupported(uint8_t featureVal) {
return ContextBase::isFeatureSupported(featureVal);
}
@@ -133,9 +138,12 @@ public:
const GpsLocationExtended& locationExtended,
enum loc_sess_status status,
LocPosTechMask loc_technology_mask,
- bool fromEngineHub=false);
+ bool fromEngineHub = false,
+ GnssDataNotification* pDataNotify = nullptr,
+ int msInWeek = -1);
virtual void reportSvEvent(const GnssSvNotification& svNotify,
bool fromEngineHub=false);
+ virtual void reportDataEvent(const GnssDataNotification& dataNotify, int msInWeek);
virtual void reportNmeaEvent(const char* nmea, size_t length);
virtual void reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet);
virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial);
diff --git a/core/LocAdapterProxyBase.h b/core/LocAdapterProxyBase.h
index 044f59b..b33d7b0 100644
--- a/core/LocAdapterProxyBase.h
+++ b/core/LocAdapterProxyBase.h
@@ -65,7 +65,6 @@ public:
GpsLocationExtended &locationExtended,
enum loc_sess_status status,
LocPosTechMask loc_technology_mask) {
-
(void)location;
(void)locationExtended;
(void)status;
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.
diff --git a/core/LocApiBase.h b/core/LocApiBase.h
index 75b98a6..ea5e071 100644
--- a/core/LocApiBase.h
+++ b/core/LocApiBase.h
@@ -116,6 +116,7 @@ protected:
close();
LOC_API_ADAPTER_EVENT_MASK_T getEvtMask();
LOC_API_ADAPTER_EVENT_MASK_T mMask;
+ uint32_t mNmeaMask;
LocApiBase(LOC_API_ADAPTER_EVENT_MASK_T excludedMask,
ContextBase* context = NULL);
inline virtual ~LocApiBase() {
@@ -154,12 +155,15 @@ public:
GpsLocationExtended& locationExtended,
enum loc_sess_status status,
LocPosTechMask loc_technology_mask =
- LOC_POS_TECH_MASK_DEFAULT);
+ LOC_POS_TECH_MASK_DEFAULT,
+ GnssDataNotification* pDataNotify = nullptr,
+ int msInWeek = -1);
void reportSv(GnssSvNotification& svNotify);
void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet);
void reportSvPolynomial(GnssSvPolynomial &svPolynomial);
void reportStatus(LocGpsStatusValue status);
void reportNmea(const char* nmea, int length);
+ void reportData(GnssDataNotification& dataNotify, int msInWeek);
void reportXtraServer(const char* url1, const char* url2,
const char* url3, const int maxlength);
void requestXtraData();
@@ -260,6 +264,7 @@ public:
void updateEvtMask();
+ void updateNmeaMask(uint32_t mask);
virtual LocationError setGpsLockSync(GnssConfigGpsLock lock);