summaryrefslogtreecommitdiff
path: root/core/LocAdapterBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/LocAdapterBase.cpp')
-rw-r--r--core/LocAdapterBase.cpp47
1 files changed, 28 insertions, 19 deletions
diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp
index 166fd91..27132b7 100644
--- a/core/LocAdapterBase.cpp
+++ b/core/LocAdapterBase.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2011-2014, 2016-2017The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -50,6 +50,16 @@ LocAdapterBase::LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
mLocApi->addAdapter(this);
}
+uint32_t LocAdapterBase::mSessionIdCounter(1);
+
+uint32_t LocAdapterBase::generateSessionId()
+{
+ if (++mSessionIdCounter == 0xFFFFFFFF)
+ mSessionIdCounter = 1;
+
+ return mSessionIdCounter;
+}
+
void LocAdapterBase::handleEngineUpEvent()
{
if (mLocAdapterProxyBase) {
@@ -65,32 +75,31 @@ void LocAdapterBase::handleEngineDownEvent()
}
void LocAdapterBase::
- reportPosition(UlpLocation &location,
- GpsLocationExtended &locationExtended,
- void* locationExt,
- enum loc_sess_status status,
- LocPosTechMask loc_technology_mask) {
- if (mLocAdapterProxyBase == NULL ||
- !mLocAdapterProxyBase->reportPosition(location,
- locationExtended,
- status,
- loc_technology_mask)) {
+ reportPositionEvent(const UlpLocation& location,
+ const GpsLocationExtended& locationExtended,
+ enum loc_sess_status status,
+ LocPosTechMask loc_technology_mask,
+ bool fromUlp) {
+ if (mLocAdapterProxyBase != NULL) {
+ mLocAdapterProxyBase->reportPositionEvent((UlpLocation&)location,
+ (GpsLocationExtended&)locationExtended,
+ status,
+ loc_technology_mask);
+ } else {
DEFAULT_IMPL()
}
}
void LocAdapterBase::
- reportSv(LocGnssSvStatus &svStatus,
- GpsLocationExtended &locationExtended,
- void* svExt)
+ reportSvEvent(const GnssSvNotification& svNotify, bool fromUlp)
DEFAULT_IMPL()
void LocAdapterBase::
- reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet)
+ reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet)
DEFAULT_IMPL()
void LocAdapterBase::
- reportSvPolynomial(GnssSvPolynomial &svPolynomial)
+ reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial)
DEFAULT_IMPL()
void LocAdapterBase::
@@ -99,7 +108,7 @@ DEFAULT_IMPL()
void LocAdapterBase::
- reportNmea(const char* nmea, int length)
+ reportNmeaEvent(const char* nmea, size_t length, bool fromUlp)
DEFAULT_IMPL()
bool LocAdapterBase::
@@ -140,11 +149,11 @@ bool LocAdapterBase::
DEFAULT_IMPL(false)
bool LocAdapterBase::
- requestNiNotify(LocGpsNiNotification &notify, const void* data)
+ requestNiNotifyEvent(GnssNiNotification &notify, const void* data)
DEFAULT_IMPL(false)
void LocAdapterBase::
- reportGnssMeasurementData(LocGnssData &gnssMeasurementData)
+ reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurementsNotify)
DEFAULT_IMPL()
bool LocAdapterBase::