summaryrefslogtreecommitdiff
path: root/core/LocApiBase.cpp
diff options
context:
space:
mode:
authorDeven Patel <cdevenp@codeaurora.org>2016-03-15 12:20:01 -0700
committerDeven Patel <cdevenp@codeaurora.org>2016-03-15 12:20:01 -0700
commita376de48267adf99805cf7c0083cc10e06873b38 (patch)
tree101a4c80aaacf10706166167e295f5e7001ca800 /core/LocApiBase.cpp
parenta29688ff347be4972133eb11ccecaf03b0d3445e (diff)
Revert "Revert "Merging m_master changes to oe_master"."
This reverts commit a29688ff347be4972133eb11ccecaf03b0d3445e Change-Id: Iab525a58ddb6a00e119afe19f4f51b07b7f428f2
Diffstat (limited to 'core/LocApiBase.cpp')
-rw-r--r--core/LocApiBase.cpp96
1 files changed, 87 insertions, 9 deletions
diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp
index 3cd2ffa..dcd35fe 100644
--- a/core/LocApiBase.cpp
+++ b/core/LocApiBase.cpp
@@ -32,7 +32,8 @@
#include <dlfcn.h>
#include <LocApiBase.h>
#include <LocAdapterBase.h>
-#include <platform_lib_includes.h>
+#include <log_util.h>
+#include <LocDualContext.h>
namespace loc_core {
@@ -125,8 +126,10 @@ struct LocOpenMsg : public LocMsg {
};
LocApiBase::LocApiBase(const MsgTask* msgTask,
- LOC_API_ADAPTER_EVENT_MASK_T excludedMask) :
- mExcludedMask(excludedMask), mMsgTask(msgTask), mMask(0)
+ LOC_API_ADAPTER_EVENT_MASK_T excludedMask,
+ ContextBase* context) :
+ mExcludedMask(excludedMask), mMsgTask(msgTask),
+ mMask(0), mSupportedMsg(0), mContext(context)
{
memset(mLocAdapters, 0, sizeof(mLocAdapters));
}
@@ -201,11 +204,18 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter)
}
}
+void LocApiBase::updateEvtMask()
+{
+ mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask()));
+}
+
void LocApiBase::handleEngineUpEvent()
{
// This will take care of renegotiating the loc handle
mMsgTask->sendMsg(new LocSsrMsg(this));
+ LocDualContext::injectFeatureConfig(mContext);
+
// loop through adapters, and deliver to all adapters.
TO_ALL_LOCADAPTERS(mLocAdapters[i]->handleEngineUpEvent());
}
@@ -222,6 +232,17 @@ void LocApiBase::reportPosition(UlpLocation &location,
enum loc_sess_status status,
LocPosTechMask loc_technology_mask)
{
+ // print the location info before delivering
+ LOC_LOGV("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: %lld\n rawDataSize: %d\n rawData: %p\n "
+ "Session status: %d\n Technology mask: %u",
+ 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);
// loop through adapters, and deliver to all adapters.
TO_ALL_LOCADAPTERS(
mLocAdapters[i]->reportPosition(location,
@@ -232,10 +253,24 @@ void LocApiBase::reportPosition(UlpLocation &location,
);
}
-void LocApiBase::reportSv(GpsSvStatus &svStatus,
+void LocApiBase::reportSv(GnssSvStatus &svStatus,
GpsLocationExtended &locationExtended,
void* svExt)
{
+ // print the SV info before delivering
+ LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n gps/glo/bds in use"
+ " mask: %x/%x/%x\n sv: prn snr elevation azimuth",
+ svStatus.num_svs, svStatus.ephemeris_mask,
+ svStatus.almanac_mask, svStatus.gps_used_in_fix_mask,
+ svStatus.glo_used_in_fix_mask, svStatus.bds_used_in_fix_mask);
+ for (int i = 0; i < svStatus.num_svs && i < GPS_MAX_SVS; i++) {
+ LOC_LOGV(" %d: %d %f %f %f",
+ i,
+ svStatus.sv_list[i].prn,
+ svStatus.sv_list[i].snr,
+ svStatus.sv_list[i].elevation,
+ svStatus.sv_list[i].azimuth);
+ }
// loop through adapters, and deliver to all adapters.
TO_ALL_LOCADAPTERS(
mLocAdapters[i]->reportSv(svStatus,
@@ -318,12 +353,23 @@ void LocApiBase::requestNiNotify(GpsNiNotification &notify, const void* data)
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotify(notify, data));
}
+void LocApiBase::saveSupportedMsgList(uint64_t supportedMsgList)
+{
+ mSupportedMsg = supportedMsgList;
+}
+
void* LocApiBase :: getSibling()
DEFAULT_IMPL(NULL)
LocApiProxyBase* LocApiBase :: getLocApiProxy()
DEFAULT_IMPL(NULL)
+void LocApiBase::reportGpsMeasurementData(GpsData &gpsMeasurementData)
+{
+ // loop through adapters, and deliver to all adapters.
+ TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGpsMeasurementData(gpsMeasurementData));
+}
+
enum loc_api_adapter_err LocApiBase::
open(LOC_API_ADAPTER_EVENT_MASK_T mask)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
@@ -404,7 +450,8 @@ enum loc_api_adapter_err LocApiBase::
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
- setSensorControlConfig(int sensorUsage)
+ setSensorControlConfig(int sensorUsage,
+ int sensorProvider)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
@@ -442,12 +489,23 @@ enum loc_api_adapter_err LocApiBase::
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
- getZppFix(GpsLocation & zppLoc)
+ getWwanZppFix(GpsLocation& zppLoc)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
- getZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask)
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
+ getBestAvailableZppFix(GpsLocation& zppLoc)
+{
+ memset(&zppLoc, 0, sizeof(zppLoc));
+ DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
+}
+
+enum loc_api_adapter_err LocApiBase::
+ getBestAvailableZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask)
+{
+ memset(&zppLoc, 0, sizeof(zppLoc));
+ memset(&tech_mask, 0, sizeof(tech_mask));
+ DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
+}
int LocApiBase::
initDataServiceClient()
@@ -466,10 +524,30 @@ void LocApiBase::
DEFAULT_IMPL()
int LocApiBase::
- setGpsLock(unsigned int lock)
+ setGpsLock(LOC_GPS_LOCK_MASK lock)
DEFAULT_IMPL(-1)
+void LocApiBase::
+ installAGpsCert(const DerEncodedCertificate* pData,
+ size_t length,
+ uint32_t slotBitMask)
+DEFAULT_IMPL()
+
int LocApiBase::
getGpsLock()
DEFAULT_IMPL(-1)
+
+enum loc_api_adapter_err LocApiBase::
+ setXtraVersionCheck(enum xtra_version_check check)
+DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
+
+int LocApiBase::
+ updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event,
+ loc_registration_mask_status isEnabled)
+DEFAULT_IMPL(-1)
+
+bool LocApiBase::
+ gnssConstellationConfig()
+DEFAULT_IMPL(false)
+
} // namespace loc_core