aboutsummaryrefslogtreecommitdiff
path: root/gps/core/LocApiBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gps/core/LocApiBase.cpp')
-rw-r--r--gps/core/LocApiBase.cpp583
1 files changed, 423 insertions, 160 deletions
diff --git a/gps/core/LocApiBase.cpp b/gps/core/LocApiBase.cpp
index 426335d..8c79cf7 100644
--- a/gps/core/LocApiBase.cpp
+++ b/gps/core/LocApiBase.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011-2014, 2016-2017 The Linux Foundation. All rights reserved.
+/* Copyright (c) 2011-2014, 2016-2019 The 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
@@ -31,10 +31,11 @@
#include <dlfcn.h>
#include <inttypes.h>
+#include <gps_extended_c.h>
#include <LocApiBase.h>
#include <LocAdapterBase.h>
#include <log_util.h>
-#include <LocDualContext.h>
+#include <LocContext.h>
namespace loc_core {
@@ -95,7 +96,10 @@ struct LocSsrMsg : public LocMsg {
}
inline virtual void proc() const {
mLocApi->close();
- mLocApi->open(mLocApi->getEvtMask());
+ if (LOC_API_ADAPTER_ERR_SUCCESS == mLocApi->open(mLocApi->getEvtMask())) {
+ // Notify adapters that engine up after SSR
+ mLocApi->handleEngineUpEvent();
+ }
}
inline void locallog() const {
LOC_LOGV("LocSsrMsg");
@@ -107,13 +111,17 @@ struct LocSsrMsg : public LocMsg {
struct LocOpenMsg : public LocMsg {
LocApiBase* mLocApi;
- inline LocOpenMsg(LocApiBase* locApi) :
- LocMsg(), mLocApi(locApi)
+ LocAdapterBase* mAdapter;
+ inline LocOpenMsg(LocApiBase* locApi, LocAdapterBase* adapter = nullptr) :
+ LocMsg(), mLocApi(locApi), mAdapter(adapter)
{
locallog();
}
inline virtual void proc() const {
- mLocApi->open(mLocApi->getEvtMask());
+ if (LOC_API_ADAPTER_ERR_SUCCESS == mLocApi->open(mLocApi->getEvtMask()) &&
+ nullptr != mAdapter) {
+ mAdapter->handleEngineUpEvent();
+ }
}
inline void locallog() const {
LOC_LOGv("LocOpen Mask: %" PRIx64 "\n", mLocApi->getEvtMask());
@@ -123,14 +131,37 @@ struct LocOpenMsg : public LocMsg {
}
};
-LocApiBase::LocApiBase(const MsgTask* msgTask,
- LOC_API_ADAPTER_EVENT_MASK_T excludedMask,
+struct LocCloseMsg : public LocMsg {
+ LocApiBase* mLocApi;
+ inline LocCloseMsg(LocApiBase* locApi) :
+ LocMsg(), mLocApi(locApi)
+ {
+ locallog();
+ }
+ inline virtual void proc() const {
+ mLocApi->close();
+ }
+ inline void locallog() const {
+ }
+ inline virtual void log() const {
+ locallog();
+ }
+};
+
+MsgTask* LocApiBase::mMsgTask = nullptr;
+volatile int32_t LocApiBase::mMsgTaskRefCount = 0;
+
+LocApiBase::LocApiBase(LOC_API_ADAPTER_EVENT_MASK_T excludedMask,
ContextBase* context) :
- mMsgTask(msgTask), mContext(context), mSupportedMsg(0),
+ mContext(context),
mMask(0), mExcludedMask(excludedMask)
{
memset(mLocAdapters, 0, sizeof(mLocAdapters));
- memset(mFeaturesSupported, 0, sizeof(mFeaturesSupported));
+
+ android_atomic_inc(&mMsgTaskRefCount);
+ if (nullptr == mMsgTask) {
+ mMsgTask = new MsgTask("LocApiMsgTask", false);
+ }
}
LOC_API_ADAPTER_EVENT_MASK_T LocApiBase::getEvtMask()
@@ -142,6 +173,18 @@ LOC_API_ADAPTER_EVENT_MASK_T LocApiBase::getEvtMask()
return mask & ~mExcludedMask;
}
+bool LocApiBase::isMaster()
+{
+ bool isMaster = false;
+
+ for (int i = 0;
+ !isMaster && i < MAX_ADAPTERS && NULL != mLocAdapters[i];
+ i++) {
+ isMaster |= mLocAdapters[i]->isAdapterMaster();
+ }
+ return isMaster;
+}
+
bool LocApiBase::isInSession()
{
bool inSession = false;
@@ -155,12 +198,41 @@ bool LocApiBase::isInSession()
return inSession;
}
+bool LocApiBase::needReport(const UlpLocation& ulpLocation,
+ enum loc_sess_status status,
+ LocPosTechMask techMask)
+{
+ bool reported = false;
+
+ if (LOC_SESS_SUCCESS == status) {
+ // this is a final fix
+ LocPosTechMask mask =
+ LOC_POS_TECH_MASK_SATELLITE | LOC_POS_TECH_MASK_SENSORS | LOC_POS_TECH_MASK_HYBRID;
+ // it is a Satellite fix or a sensor fix
+ reported = (mask & techMask);
+ }
+ else if (LOC_SESS_INTERMEDIATE == status &&
+ LOC_SESS_INTERMEDIATE == ContextBase::mGps_conf.INTERMEDIATE_POS) {
+ // this is a intermediate fix and we accept intermediate
+
+ // it is NOT the case that
+ // there is inaccuracy; and
+ // we care about inaccuracy; and
+ // the inaccuracy exceeds our tolerance
+ reported = !((ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_ACCURACY) &&
+ (ContextBase::mGps_conf.ACCURACY_THRES != 0) &&
+ (ulpLocation.gpsLocation.accuracy > ContextBase::mGps_conf.ACCURACY_THRES));
+ }
+
+ return reported;
+}
+
void LocApiBase::addAdapter(LocAdapterBase* adapter)
{
for (int i = 0; i < MAX_ADAPTERS && mLocAdapters[i] != adapter; i++) {
if (mLocAdapters[i] == NULL) {
mLocAdapters[i] = adapter;
- mMsgTask->sendMsg(new LocOpenMsg(this));
+ sendMsg(new LocOpenMsg(this, adapter));
break;
}
}
@@ -193,10 +265,10 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter)
// if we have an empty list of adapters
if (0 == i) {
- close();
+ sendMsg(new LocCloseMsg(this));
} else {
// else we need to remove the bit
- mMsgTask->sendMsg(new LocOpenMsg(this));
+ sendMsg(new LocOpenMsg(this));
}
}
}
@@ -204,22 +276,43 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter)
void LocApiBase::updateEvtMask()
{
- open(getEvtMask());
+ sendMsg(new LocOpenMsg(this));
}
-void LocApiBase::handleEngineUpEvent()
+void LocApiBase::updateNmeaMask(uint32_t mask)
{
- // This will take care of renegotiating the loc handle
- mMsgTask->sendMsg(new LocSsrMsg(this));
+ 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();
+ }
+ };
- LocDualContext::injectFeatureConfig(mContext);
+ sendMsg(new LocSetNmeaMsg(this, mask));
+}
+void LocApiBase::handleEngineUpEvent()
+{
// loop through adapters, and deliver to all adapters.
TO_ALL_LOCADAPTERS(mLocAdapters[i]->handleEngineUpEvent());
}
void LocApiBase::handleEngineDownEvent()
-{
+{ // This will take care of renegotiating the loc handle
+ sendMsg(new LocSsrMsg(this));
+
// loop through adapters, and deliver to all adapters.
TO_ALL_LOCADAPTERS(mLocAdapters[i]->handleEngineDownEvent());
}
@@ -227,21 +320,22 @@ 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 "
"altitude: %f\n speed: %f\n bearing: %f\n accuracy: %f\n "
- "timestamp: %" PRId64 "\n rawDataSize: %d\n rawData: %p\n "
+ "timestamp: %" PRId64 "\n"
"Session status: %d\n Technology mask: %u\n "
"SV used in fix (gps/glo/bds/gal/qzss) : \
- (%" PRIx64 "/%" PRIx64 "/%" PRIx64 "/%" PRIx64 "/%" PRIx64 ")",
+ (0x%" PRIx64 "/0x%" PRIx64 "/0x%" PRIx64 "/0x%" PRIx64 "/0x%" PRIx64 ")",
location.gpsLocation.flags, location.position_source,
location.gpsLocation.latitude, location.gpsLocation.longitude,
location.gpsLocation.altitude, location.gpsLocation.speed,
location.gpsLocation.bearing, location.gpsLocation.accuracy,
- location.gpsLocation.timestamp, location.rawDataSize,
- location.rawData, status, loc_technology_mask,
+ location.gpsLocation.timestamp, status, loc_technology_mask,
locationExtended.gnss_sv_used_ids.gps_sv_used_ids_mask,
locationExtended.gnss_sv_used_ids.glo_sv_used_ids_mask,
locationExtended.gnss_sv_used_ids.bds_sv_used_ids_mask,
@@ -250,7 +344,8 @@ 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,
+ pDataNotify, msInWeek)
);
}
@@ -260,19 +355,57 @@ void LocApiBase::reportWwanZppFix(LocGpsLocation &zppLoc)
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportWwanZppFix(zppLoc));
}
-void LocApiBase::reportOdcpiRequest(OdcpiRequestInfo& request)
+void LocApiBase::reportZppBestAvailableFix(LocGpsLocation &zppLoc,
+ GpsLocationExtended &location_extended, LocPosTechMask tech_mask)
+{
+ // loop through adapters, and deliver to the first handling adapter.
+ TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportZppBestAvailableFix(zppLoc,
+ location_extended, tech_mask));
+}
+
+void LocApiBase::requestOdcpi(OdcpiRequestInfo& request)
+{
+ // loop through adapters, and deliver to the first handling adapter.
+ TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestOdcpiEvent(request));
+}
+
+void LocApiBase::reportGnssEngEnergyConsumedEvent(uint64_t energyConsumedSinceFirstBoot)
+{
+ // loop through adapters, and deliver to the first handling adapter.
+ TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssEngEnergyConsumedEvent(
+ energyConsumedSinceFirstBoot));
+}
+
+void LocApiBase::reportDeleteAidingDataEvent(GnssAidingData& aidingData) {
+ // loop through adapters, and deliver to the first handling adapter.
+ TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportDeleteAidingDataEvent(aidingData));
+}
+
+void LocApiBase::reportKlobucharIonoModel(GnssKlobucharIonoModel & ionoModel) {
+ // loop through adapters, and deliver to the first handling adapter.
+ TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportKlobucharIonoModelEvent(ionoModel));
+}
+
+void LocApiBase::reportGnssAdditionalSystemInfo(GnssAdditionalSystemInfo& additionalSystemInfo) {
+ // loop through adapters, and deliver to the first handling adapter.
+ TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportGnssAdditionalSystemInfoEvent(
+ additionalSystemInfo));
+}
+
+void LocApiBase::sendNfwNotification(GnssNfwNotification& notification)
{
// loop through adapters, and deliver to the first handling adapter.
- TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportOdcpiRequestEvent(request));
+ TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportNfwNotificationEvent(notification));
+
}
void LocApiBase::reportSv(GnssSvNotification& svNotify)
{
const char* constellationString[] = { "Unknown", "GPS", "SBAS", "GLONASS",
- "QZSS", "BEIDOU", "GALILEO" };
+ "QZSS", "BEIDOU", "GALILEO", "NAVIC" };
// print the SV info before delivering
- LOC_LOGV("num sv: %zu\n"
+ LOC_LOGV("num sv: %u\n"
" sv: constellation svid cN0"
" elevation azimuth flags",
svNotify.count);
@@ -281,14 +414,19 @@ void LocApiBase::reportSv(GnssSvNotification& svNotify)
sizeof(constellationString) / sizeof(constellationString[0]) - 1) {
svNotify.gnssSvs[i].type = GNSS_SV_TYPE_UNKNOWN;
}
- LOC_LOGV(" %03zu: %*s %02d %f %f %f 0x%02X",
+ // Display what we report to clients
+ uint16_t displaySvId = GNSS_SV_TYPE_QZSS == svNotify.gnssSvs[i].type ?
+ svNotify.gnssSvs[i].svId + QZSS_SV_PRN_MIN - 1 :
+ svNotify.gnssSvs[i].svId;
+ LOC_LOGV(" %03zu: %*s %02d %f %f %f %f 0x%02X",
i,
13,
constellationString[svNotify.gnssSvs[i].type],
- svNotify.gnssSvs[i].svId,
+ displaySvId,
svNotify.gnssSvs[i].cN0Dbhz,
svNotify.gnssSvs[i].elevation,
svNotify.gnssSvs[i].azimuth,
+ svNotify.gnssSvs[i].carrierFrequencyHz,
svNotify.gnssSvs[i].gnssSvOptionsMask);
}
// loop through adapters, and deliver to all adapters.
@@ -297,19 +435,19 @@ void LocApiBase::reportSv(GnssSvNotification& svNotify)
);
}
-void LocApiBase::reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet)
+void LocApiBase::reportSvPolynomial(GnssSvPolynomial &svPolynomial)
{
// loop through adapters, and deliver to all adapters.
TO_ALL_LOCADAPTERS(
- mLocAdapters[i]->reportSvMeasurementEvent(svMeasurementSet)
+ mLocAdapters[i]->reportSvPolynomialEvent(svPolynomial)
);
}
-void LocApiBase::reportSvPolynomial(GnssSvPolynomial &svPolynomial)
+void LocApiBase::reportSvEphemeris(GnssSvEphemerisReport & svEphemeris)
{
// loop through adapters, and deliver to all adapters.
TO_ALL_LOCADAPTERS(
- mLocAdapters[i]->reportSvPolynomialEvent(svPolynomial)
+ mLocAdapters[i]->reportSvEphemerisEvent(svEphemeris)
);
}
@@ -319,6 +457,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.
@@ -333,6 +477,12 @@ void LocApiBase::reportXtraServer(const char* url1, const char* url2,
}
+void LocApiBase::reportLocationSystemInfo(const LocationSystemInfo& locationSystemInfo)
+{
+ // loop through adapters, and deliver to all adapters.
+ TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportLocationSystemInfoEvent(locationSystemInfo));
+}
+
void LocApiBase::requestXtraData()
{
// loop through adapters, and deliver to the first handling adapter.
@@ -351,10 +501,12 @@ void LocApiBase::requestLocation()
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestLocation());
}
-void LocApiBase::requestATL(int connHandle, LocAGpsType agps_type)
+void LocApiBase::requestATL(int connHandle, LocAGpsType agps_type,
+ LocApnTypeMask apn_type_mask)
{
// loop through adapters, and deliver to the first handling adapter.
- TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestATL(connHandle, agps_type));
+ TO_1ST_HANDLING_LOCADAPTERS(
+ mLocAdapters[i]->requestATL(connHandle, agps_type, apn_type_mask));
}
void LocApiBase::releaseATL(int connHandle)
@@ -363,145 +515,160 @@ void LocApiBase::releaseATL(int connHandle)
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->releaseATL(connHandle));
}
-void LocApiBase::requestSuplES(int connHandle)
+void LocApiBase::requestNiNotify(GnssNiNotification &notify, const void* data,
+ const LocInEmergency emergencyState)
{
// loop through adapters, and deliver to the first handling adapter.
- TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestSuplES(connHandle));
+ TO_1ST_HANDLING_LOCADAPTERS(
+ mLocAdapters[i]->requestNiNotifyEvent(notify,
+ data,
+ emergencyState));
}
-void LocApiBase::reportDataCallOpened()
+void* LocApiBase :: getSibling()
+ DEFAULT_IMPL(NULL)
+
+LocApiProxyBase* LocApiBase :: getLocApiProxy()
+ DEFAULT_IMPL(NULL)
+
+void LocApiBase::reportGnssMeasurements(GnssMeasurements& gnssMeasurements, int msInWeek)
{
- // loop through adapters, and deliver to the first handling adapter.
- TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportDataCallOpened());
+ // loop through adapters, and deliver to all adapters.
+ TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssMeasurementsEvent(gnssMeasurements, msInWeek));
}
-void LocApiBase::reportDataCallClosed()
+void LocApiBase::reportGnssSvIdConfig(const GnssSvIdConfig& config)
{
- // loop through adapters, and deliver to the first handling adapter.
- TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportDataCallClosed());
+ // Print the config
+ LOC_LOGv("gloBlacklistSvMask: %" PRIu64 ", bdsBlacklistSvMask: %" PRIu64 ",\n"
+ "qzssBlacklistSvMask: %" PRIu64 ", galBlacklistSvMask: %" PRIu64,
+ config.gloBlacklistSvMask, config.bdsBlacklistSvMask,
+ config.qzssBlacklistSvMask, config.galBlacklistSvMask);
+
+ // Loop through adapters, and deliver to all adapters.
+ TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssSvIdConfigEvent(config));
}
-void LocApiBase::requestNiNotify(GnssNiNotification &notify, const void* data)
+void LocApiBase::reportGnssSvTypeConfig(const GnssSvTypeConfig& config)
{
- // loop through adapters, and deliver to the first handling adapter.
- TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotifyEvent(notify, data));
+ // Print the config
+ LOC_LOGv("blacklistedMask: %" PRIu64 ", enabledMask: %" PRIu64,
+ config.blacklistedSvTypesMask, config.enabledSvTypesMask);
+
+ // Loop through adapters, and deliver to all adapters.
+ TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssSvTypeConfigEvent(config));
}
-void LocApiBase::saveSupportedMsgList(uint64_t supportedMsgList)
+void LocApiBase::geofenceBreach(size_t count, uint32_t* hwIds, Location& location,
+ GeofenceBreachType breachType, uint64_t timestamp)
{
- mSupportedMsg = supportedMsgList;
+ TO_ALL_LOCADAPTERS(mLocAdapters[i]->geofenceBreachEvent(count, hwIds, location, breachType,
+ timestamp));
}
-void LocApiBase::saveSupportedFeatureList(uint8_t *featureList)
+void LocApiBase::geofenceStatus(GeofenceStatusAvailable available)
{
- memcpy((void *)mFeaturesSupported, (void *)featureList, sizeof(mFeaturesSupported));
+ TO_ALL_LOCADAPTERS(mLocAdapters[i]->geofenceStatusEvent(available));
}
-void* LocApiBase :: getSibling()
- DEFAULT_IMPL(NULL)
+void LocApiBase::reportDBTPosition(UlpLocation &location, GpsLocationExtended &locationExtended,
+ enum loc_sess_status status, LocPosTechMask loc_technology_mask)
+{
+ TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportPositionEvent(location, locationExtended, status,
+ loc_technology_mask));
+}
-LocApiProxyBase* LocApiBase :: getLocApiProxy()
- DEFAULT_IMPL(NULL)
+void LocApiBase::reportLocations(Location* locations, size_t count, BatchingMode batchingMode)
+{
+ TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportLocationsEvent(locations, count, batchingMode));
+}
-void LocApiBase::reportGnssMeasurementData(GnssMeasurementsNotification& measurements,
- int msInWeek)
+void LocApiBase::reportCompletedTrips(uint32_t accumulated_distance)
{
- // loop through adapters, and deliver to all adapters.
- TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssMeasurementDataEvent(measurements, msInWeek));
+ TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportCompletedTripsEvent(accumulated_distance));
}
-enum loc_api_adapter_err LocApiBase::
- open(LOC_API_ADAPTER_EVENT_MASK_T /*mask*/)
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
+void LocApiBase::handleBatchStatusEvent(BatchingStatus batchStatus)
+{
+ TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportBatchStatusChangeEvent(batchStatus));
+}
-enum loc_api_adapter_err LocApiBase::
- close()
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
- startFix(const LocPosMode& /*posMode*/)
+ open(LOC_API_ADAPTER_EVENT_MASK_T /*mask*/)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
- stopFix()
+ close()
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
-LocationError LocApiBase::
- deleteAidingData(const GnssAidingData& /*data*/)
-DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
+void LocApiBase::startFix(const LocPosMode& /*posMode*/, LocApiResponse* /*adapterResponse*/)
+DEFAULT_IMPL()
-enum loc_api_adapter_err LocApiBase::
- enableData(int /*enable*/)
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
+void LocApiBase::stopFix(LocApiResponse* /*adapterResponse*/)
+DEFAULT_IMPL()
-enum loc_api_adapter_err LocApiBase::
- setAPN(char* /*apn*/, int /*len*/)
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
+void LocApiBase::
+ deleteAidingData(const GnssAidingData& /*data*/, LocApiResponse* /*adapterResponse*/)
+DEFAULT_IMPL()
-enum loc_api_adapter_err LocApiBase::
+void LocApiBase::
injectPosition(double /*latitude*/, double /*longitude*/, float /*accuracy*/)
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
+DEFAULT_IMPL()
-enum loc_api_adapter_err LocApiBase::
- injectPosition(const Location& /*location*/)
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
+void LocApiBase::
+ injectPosition(const Location& /*location*/, bool /*onDemandCpi*/)
+DEFAULT_IMPL()
-enum loc_api_adapter_err LocApiBase::
+void LocApiBase::
+ injectPosition(const GnssLocationInfoNotification & /*locationInfo*/, bool /*onDemandCpi*/)
+DEFAULT_IMPL()
+
+void LocApiBase::
setTime(LocGpsUtcTime /*time*/, int64_t /*timeReference*/, int /*uncertainty*/)
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
+DEFAULT_IMPL()
enum loc_api_adapter_err LocApiBase::
setXtraData(char* /*data*/, int /*length*/)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
-enum loc_api_adapter_err LocApiBase::
- requestXtraServer()
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
-
-enum loc_api_adapter_err LocApiBase::
- atlOpenStatus(int /*handle*/, int /*is_succ*/, char* /*apn*/,
- AGpsBearerType /*bear*/, LocAGpsType /*agpsType*/)
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
+void LocApiBase::
+ atlOpenStatus(int /*handle*/, int /*is_succ*/, char* /*apn*/, uint32_t /*apnLen*/,
+ AGpsBearerType /*bear*/, LocAGpsType /*agpsType*/,
+ LocApnTypeMask /*mask*/)
+DEFAULT_IMPL()
-enum loc_api_adapter_err LocApiBase::
+void LocApiBase::
atlCloseStatus(int /*handle*/, int /*is_succ*/)
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
-
-enum loc_api_adapter_err LocApiBase::
- setPositionMode(const LocPosMode& /*posMode*/)
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
+DEFAULT_IMPL()
LocationError LocApiBase::
- setServer(const char* /*url*/, int /*len*/)
+ setServerSync(const char* /*url*/, int /*len*/, LocServerType /*type*/)
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
LocationError LocApiBase::
- setServer(unsigned int /*ip*/, int /*port*/, LocServerType /*type*/)
+ setServerSync(unsigned int /*ip*/, int /*port*/, LocServerType /*type*/)
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
-LocationError LocApiBase::
+void LocApiBase::
informNiResponse(GnssNiResponse /*userResponse*/, const void* /*passThroughData*/)
-DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
+DEFAULT_IMPL()
LocationError LocApiBase::
- setSUPLVersion(GnssConfigSuplVersion /*version*/)
+ setSUPLVersionSync(GnssConfigSuplVersion /*version*/)
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
- setNMEATypes (uint32_t /*typesMask*/)
+ setNMEATypesSync (uint32_t /*typesMask*/)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
LocationError LocApiBase::
- setLPPConfig(GnssConfigLppProfile /*profile*/)
+ setLPPConfigSync(GnssConfigLppProfile /*profile*/)
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
-enum loc_api_adapter_err LocApiBase::
- setSensorControlConfig(int /*sensorUsage*/,
- int /*sensorProvider*/)
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
- setSensorProperties(bool /*gyroBiasVarianceRandomWalk_valid*/,
+ setSensorPropertiesSync(bool /*gyroBiasVarianceRandomWalk_valid*/,
float /*gyroBiasVarianceRandomWalk*/,
bool /*accelBiasVarianceRandomWalk_valid*/,
float /*accelBiasVarianceRandomWalk*/,
@@ -514,7 +681,7 @@ enum loc_api_adapter_err LocApiBase::
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
- setSensorPerfControlConfig(int /*controlMode*/,
+ setSensorPerfControlConfigSync(int /*controlMode*/,
int /*accelSamplesPerBatch*/,
int /*accelBatchesPerSec*/,
int /*gyroSamplesPerBatch*/,
@@ -527,88 +694,184 @@ enum loc_api_adapter_err LocApiBase::
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
LocationError LocApiBase::
- setAGLONASSProtocol(GnssConfigAGlonassPositionProtocolMask /*aGlonassProtocol*/)
+ setAGLONASSProtocolSync(GnssConfigAGlonassPositionProtocolMask /*aGlonassProtocol*/)
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
LocationError LocApiBase::
- setLPPeProtocolCp(GnssConfigLppeControlPlaneMask /*lppeCP*/)
+ setLPPeProtocolCpSync(GnssConfigLppeControlPlaneMask /*lppeCP*/)
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
LocationError LocApiBase::
- setLPPeProtocolUp(GnssConfigLppeUserPlaneMask /*lppeUP*/)
+ setLPPeProtocolUpSync(GnssConfigLppeUserPlaneMask /*lppeUP*/)
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
-enum loc_api_adapter_err LocApiBase::
- getWwanZppFix()
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
+GnssConfigSuplVersion LocApiBase::convertSuplVersion(const uint32_t /*suplVersion*/)
+DEFAULT_IMPL(GNSS_CONFIG_SUPL_VERSION_1_0_0)
-enum loc_api_adapter_err LocApiBase::
- getBestAvailableZppFix(LocGpsLocation& zppLoc)
-{
- memset(&zppLoc, 0, sizeof(zppLoc));
- DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
-}
+GnssConfigLppProfile LocApiBase::convertLppProfile(const uint32_t /*lppProfile*/)
+DEFAULT_IMPL(GNSS_CONFIG_LPP_PROFILE_RRLP_ON_LTE)
-enum loc_api_adapter_err LocApiBase::
- getBestAvailableZppFix(LocGpsLocation & zppLoc, GpsLocationExtended & locationExtended,
- LocPosTechMask & tech_mask)
-{
- memset(&zppLoc, 0, sizeof(zppLoc));
- memset(&tech_mask, 0, sizeof(tech_mask));
- memset(&locationExtended, 0, sizeof (locationExtended));
- DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
-}
+GnssConfigLppeControlPlaneMask LocApiBase::convertLppeCp(const uint32_t /*lppeControlPlaneMask*/)
+DEFAULT_IMPL(0)
-int LocApiBase::
- initDataServiceClient(bool /*isDueToSsr*/)
-DEFAULT_IMPL(-1)
+GnssConfigLppeUserPlaneMask LocApiBase::convertLppeUp(const uint32_t /*lppeUserPlaneMask*/)
+DEFAULT_IMPL(0)
-int LocApiBase::
- openAndStartDataCall()
-DEFAULT_IMPL(-1)
-
-void LocApiBase::
- stopDataCall()
-DEFAULT_IMPL()
+LocationError LocApiBase::setEmergencyExtensionWindowSync(
+ const uint32_t /*emergencyExtensionSeconds*/)
+DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
void LocApiBase::
- closeDataCall()
+ getWwanZppFix()
DEFAULT_IMPL()
void LocApiBase::
- releaseDataServiceClient()
+ getBestAvailableZppFix()
DEFAULT_IMPL()
LocationError LocApiBase::
- setGpsLock(GnssConfigGpsLock /*lock*/)
+ setGpsLockSync(GnssConfigGpsLock /*lock*/)
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
void LocApiBase::
+ requestForAidingData(GnssAidingDataSvMask /*svDataMask*/)
+DEFAULT_IMPL()
+
+void LocApiBase::
installAGpsCert(const LocDerEncodedCertificate* /*pData*/,
size_t /*length*/,
uint32_t /*slotBitMask*/)
DEFAULT_IMPL()
-int LocApiBase::
- getGpsLock()
-DEFAULT_IMPL(-1)
+LocationError LocApiBase::
+ setXtraVersionCheckSync(uint32_t /*check*/)
+DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
+
+LocationError LocApiBase::setBlacklistSvSync(const GnssSvIdConfig& /*config*/)
+DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
+
+void LocApiBase::setBlacklistSv(const GnssSvIdConfig& /*config*/)
+DEFAULT_IMPL()
+
+void LocApiBase::getBlacklistSv()
+DEFAULT_IMPL()
+
+void LocApiBase::setConstellationControl(const GnssSvTypeConfig& /*config*/)
+DEFAULT_IMPL()
+
+void LocApiBase::getConstellationControl()
+DEFAULT_IMPL()
+
+void LocApiBase::resetConstellationControl()
+DEFAULT_IMPL()
LocationError LocApiBase::
- setXtraVersionCheck(uint32_t /*check*/)
+ setConstrainedTuncMode(bool /*enabled*/,
+ float /*tuncConstraint*/,
+ uint32_t /*energyBudget*/)
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
-bool LocApiBase::
- gnssConstellationConfig()
-DEFAULT_IMPL(false)
+LocationError LocApiBase::
+ setPositionAssistedClockEstimatorMode(bool /*enabled*/)
+DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
-bool LocApiBase::
- isFeatureSupported(uint8_t featureVal)
-{
- uint8_t arrayIndex = featureVal >> 3;
- uint8_t bitPos = featureVal & 7;
+LocationError LocApiBase::getGnssEnergyConsumed()
+DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
+
+
+void LocApiBase::addGeofence(uint32_t /*clientId*/, const GeofenceOption& /*options*/,
+ const GeofenceInfo& /*info*/,
+ LocApiResponseData<LocApiGeofenceData>* /*adapterResponseData*/)
+DEFAULT_IMPL()
+
+void LocApiBase::removeGeofence(uint32_t /*hwId*/, uint32_t /*clientId*/,
+ LocApiResponse* /*adapterResponse*/)
+DEFAULT_IMPL()
+
+void LocApiBase::pauseGeofence(uint32_t /*hwId*/, uint32_t /*clientId*/,
+ LocApiResponse* /*adapterResponse*/)
+DEFAULT_IMPL()
+
+void LocApiBase::resumeGeofence(uint32_t /*hwId*/, uint32_t /*clientId*/,
+ LocApiResponse* /*adapterResponse*/)
+DEFAULT_IMPL()
+
+void LocApiBase::modifyGeofence(uint32_t /*hwId*/, uint32_t /*clientId*/,
+ const GeofenceOption& /*options*/, LocApiResponse* /*adapterResponse*/)
+DEFAULT_IMPL()
+
+void LocApiBase::startTimeBasedTracking(const TrackingOptions& /*options*/,
+ LocApiResponse* /*adapterResponse*/)
+DEFAULT_IMPL()
+
+void LocApiBase::stopTimeBasedTracking(LocApiResponse* /*adapterResponse*/)
+DEFAULT_IMPL()
+
+void LocApiBase::startDistanceBasedTracking(uint32_t /*sessionId*/,
+ const LocationOptions& /*options*/, LocApiResponse* /*adapterResponse*/)
+DEFAULT_IMPL()
+
+void LocApiBase::stopDistanceBasedTracking(uint32_t /*sessionId*/,
+ LocApiResponse* /*adapterResponse*/)
+DEFAULT_IMPL()
+
+void LocApiBase::startBatching(uint32_t /*sessionId*/, const LocationOptions& /*options*/,
+ uint32_t /*accuracy*/, uint32_t /*timeout*/, LocApiResponse* /*adapterResponse*/)
+DEFAULT_IMPL()
+
+void LocApiBase::stopBatching(uint32_t /*sessionId*/, LocApiResponse* /*adapterResponse*/)
+DEFAULT_IMPL()
+
+LocationError LocApiBase::startOutdoorTripBatchingSync(uint32_t /*tripDistance*/,
+ uint32_t /*tripTbf*/, uint32_t /*timeout*/)
+DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
+
+void LocApiBase::startOutdoorTripBatching(uint32_t /*tripDistance*/, uint32_t /*tripTbf*/,
+ uint32_t /*timeout*/, LocApiResponse* /*adapterResponse*/)
+DEFAULT_IMPL()
+
+void LocApiBase::reStartOutdoorTripBatching(uint32_t /*ongoingTripDistance*/,
+ uint32_t /*ongoingTripInterval*/, uint32_t /*batchingTimeout,*/,
+ LocApiResponse* /*adapterResponse*/)
+DEFAULT_IMPL()
+
+LocationError LocApiBase::stopOutdoorTripBatchingSync(bool /*deallocBatchBuffer*/)
+DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
+
+void LocApiBase::stopOutdoorTripBatching(bool /*deallocBatchBuffer*/,
+ LocApiResponse* /*adapterResponse*/)
+DEFAULT_IMPL()
+
+LocationError LocApiBase::getBatchedLocationsSync(size_t /*count*/)
+DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
+
+void LocApiBase::getBatchedLocations(size_t /*count*/, LocApiResponse* /*adapterResponse*/)
+DEFAULT_IMPL()
+
+LocationError LocApiBase::getBatchedTripLocationsSync(size_t /*count*/,
+ uint32_t /*accumulatedDistance*/)
+DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
+
+void LocApiBase::getBatchedTripLocations(size_t /*count*/, uint32_t /*accumulatedDistance*/,
+ LocApiResponse* /*adapterResponse*/)
+DEFAULT_IMPL()
+
+LocationError LocApiBase::queryAccumulatedTripDistanceSync(uint32_t& /*accumulated_trip_distance*/,
+ uint32_t& /*numOfBatchedPositions*/)
+DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
+
+void LocApiBase::queryAccumulatedTripDistance(
+ LocApiResponseData<LocApiBatchData>* /*adapterResponseData*/)
+DEFAULT_IMPL()
+
+void LocApiBase::setBatchSize(size_t /*size*/)
+DEFAULT_IMPL()
+
+void LocApiBase::setTripBatchSize(size_t /*size*/)
+DEFAULT_IMPL()
+
+void LocApiBase::addToCallQueue(LocApiResponse* /*adapterResponse*/)
+DEFAULT_IMPL()
- if (arrayIndex >= MAX_FEATURE_LENGTH) return false;
- return ((mFeaturesSupported[arrayIndex] >> bitPos ) & 0x1);
-}
} // namespace loc_core