summaryrefslogtreecommitdiff
path: root/core/LocApiBase.h
diff options
context:
space:
mode:
authorKevin Tang <zhikait@codeaurora.org>2016-02-04 10:03:40 -0800
committerKevin Tang <zhikait@codeaurora.org>2016-02-04 10:03:40 -0800
commit1aeb6bad84c0afd0e032c3d4d7e33959501e18f1 (patch)
tree3518628e958d4e939b72e1d32a1618e6056e653d /core/LocApiBase.h
parentdb367819e26af1a6b8cb013e0dcda575d242c732 (diff)
parent89f41a9b1602ce82ea6272f2a3be8595fb4b6058 (diff)
downloadgps-1aeb6bad84c0afd0e032c3d4d7e33959501e18f1.tar.gz
Merging m_master changes to oe_master
Merging LA m_master changes to oe_master merge head - 89f41a9b1602ce82ea6272f2a3be8595fb4b6058 Change-Id: I9010487f1d6f3d2e30a568b441bc5f9b719a0fb1
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