summaryrefslogtreecommitdiff
path: root/core/LocApiBase.h
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.h
parenta29688ff347be4972133eb11ccecaf03b0d3445e (diff)
downloadgps-a376de48267adf99805cf7c0083cc10e06873b38.tar.gz
Revert "Revert "Merging m_master changes to oe_master"."
This reverts commit a29688ff347be4972133eb11ccecaf03b0d3445e Change-Id: Iab525a58ddb6a00e119afe19f4f51b07b7f428f2
Diffstat (limited to 'core/LocApiBase.h')
-rw-r--r--core/LocApiBase.h60
1 files changed, 51 insertions, 9 deletions
diff --git a/core/LocApiBase.h b/core/LocApiBase.h
index c48927c..5a2c56f 100644
--- a/core/LocApiBase.h
+++ b/core/LocApiBase.h
@@ -36,6 +36,7 @@
#include <platform_lib_log_util.h>
namespace loc_core {
+class ContextBase;
int hexcode(char *hexstring, int string_size,
const char *data, int data_size);
@@ -52,6 +53,13 @@ int decodeAddress(char *addr_string, int string_size,
#define TO_1ST_HANDLING_ADAPTER(adapters, call) \
for (int i = 0; i <MAX_ADAPTERS && NULL != (adapters)[i] && !(call); i++);
+enum xtra_version_check {
+ DISABLED,
+ AUTO,
+ XTRA2,
+ XTRA3
+};
+
class LocAdapterBase;
struct LocSsrMsg;
struct LocOpenMsg;
@@ -70,8 +78,9 @@ class LocApiBase {
friend struct LocOpenMsg;
friend class ContextBase;
const MsgTask* mMsgTask;
-
+ ContextBase *mContext;
LocAdapterBase* mLocAdapters[MAX_ADAPTERS];
+ uint64_t mSupportedMsg;
protected:
virtual enum loc_api_adapter_err
@@ -81,12 +90,17 @@ protected:
LOC_API_ADAPTER_EVENT_MASK_T getEvtMask();
LOC_API_ADAPTER_EVENT_MASK_T mMask;
LocApiBase(const MsgTask* msgTask,
- LOC_API_ADAPTER_EVENT_MASK_T excludedMask);
+ LOC_API_ADAPTER_EVENT_MASK_T excludedMask,
+ ContextBase* context = NULL);
inline virtual ~LocApiBase() { close(); }
bool isInSession();
const LOC_API_ADAPTER_EVENT_MASK_T mExcludedMask;
public:
+ inline void sendMsg(const LocMsg* msg) const {
+ mMsgTask->sendMsg(msg);
+ }
+
void addAdapter(LocAdapterBase* adapter);
void removeAdapter(LocAdapterBase* adapter);
@@ -99,7 +113,7 @@ public:
enum loc_sess_status status,
LocPosTechMask loc_technology_mask =
LOC_POS_TECH_MASK_DEFAULT);
- void reportSv(GpsSvStatus &svStatus,
+ void reportSv(GnssSvStatus &svStatus,
GpsLocationExtended &locationExtended,
void* svExt);
void reportStatus(GpsStatusValue status);
@@ -115,6 +129,8 @@ public:
void reportDataCallOpened();
void reportDataCallClosed();
void requestNiNotify(GpsNiNotification &notify, const void* data);
+ void saveSupportedMsgList(uint64_t supportedMsgList);
+ void reportGpsMeasurementData(GpsData &gpsMeasurementData);
// downward calls
// All below functions are to be defined by adapter specific modules:
@@ -158,7 +174,7 @@ public:
virtual enum loc_api_adapter_err
setLPPConfig(uint32_t profile);
virtual enum loc_api_adapter_err
- setSensorControlConfig(int sensorUsage);
+ setSensorControlConfig(int sensorUsage, int sensorProvider);
virtual enum loc_api_adapter_err
setSensorProperties(bool gyroBiasVarianceRandomWalk_valid,
float gyroBiasVarianceRandomWalk,
@@ -186,15 +202,28 @@ public:
virtual enum loc_api_adapter_err
setAGLONASSProtocol(unsigned long aGlonassProtocol);
virtual enum loc_api_adapter_err
- getZppFix(GpsLocation & zppLoc);
+ getWwanZppFix(GpsLocation & zppLoc);
+ virtual enum loc_api_adapter_err
+ getBestAvailableZppFix(GpsLocation & zppLoc);
virtual enum loc_api_adapter_err
- getZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask);
+ getBestAvailableZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask);
virtual int initDataServiceClient();
virtual int openAndStartDataCall();
virtual void stopDataCall();
virtual void closeDataCall();
-
+ virtual void installAGpsCert(const DerEncodedCertificate* pData,
+ size_t length,
+ uint32_t slotBitMask);
inline virtual void setInSession(bool inSession) {}
+ inline bool isMessageSupported (LocCheckingMessagesID msgID) const {
+ if (msgID > (sizeof(mSupportedMsg) << 3)) {
+ return false;
+ } else {
+ uint32_t messageChecker = 1 << msgID;
+ return (messageChecker & mSupportedMsg) == messageChecker;
+ }
+ }
+ void updateEvtMask();
/*Values for lock
1 = Do not lock any position sessions
@@ -202,17 +231,30 @@ public:
3 = Lock MT position sessions
4 = Lock all position sessions
*/
- virtual int setGpsLock(unsigned int lock);
+ virtual int setGpsLock(LOC_GPS_LOCK_MASK lock);
/*
Returns
Current value of GPS Lock on success
-1 on failure
*/
virtual int getGpsLock(void);
+
+ virtual enum loc_api_adapter_err setXtraVersionCheck(enum xtra_version_check check);
+
+ /*
+ Update gps reporting events
+ */
+ virtual int updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event,
+ loc_registration_mask_status isEnabled);
+ /*
+ Check if the modem support the service
+ */
+ virtual bool gnssConstellationConfig();
};
typedef LocApiBase* (getLocApi_t)(const MsgTask* msgTask,
- LOC_API_ADAPTER_EVENT_MASK_T exMask);
+ LOC_API_ADAPTER_EVENT_MASK_T exMask,
+ ContextBase *context);
} // namespace loc_core