summaryrefslogtreecommitdiff
path: root/core/LocAdapterBase.cpp
diff options
context:
space:
mode:
authorDante Russo <drusso@codeaurora.org>2017-02-28 16:45:47 -0800
committerDante Russo <drusso@codeaurora.org>2017-02-28 16:47:50 -0800
commitc85c8ff673e4347cea911b353de120f639b39b83 (patch)
tree5fe203230801cf76dc1823b6d05a44ea94663883 /core/LocAdapterBase.cpp
parent4bb940c0679ab23c9b8954bcb9ad8da5ede093cd (diff)
downloadgps-c85c8ff673e4347cea911b353de120f639b39b83.tar.gz
LocationAPI implementation
Implementation of LocationAPI into gps hal to be a common API that is called into by platform specific APIs. Change-Id: Ie5a7bd217d4ae2175ad49e6aca2fb6ecd4702f3b CRs-fixed: 1112712
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::