summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-06-21 00:41:28 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-06-21 00:41:28 -0700
commit17e8653d96a957b6a163a622040c48878f1372ed (patch)
treef14d6bb0619d9281c3eb3c35c75aa77f98ab2a18
parent023ea00a29c7e7d5fdc9fa5b315adcb911e01aa0 (diff)
parent310aa84028c4d8953f2be04131a9a0ed1d258bd8 (diff)
downloadgps-17e8653d96a957b6a163a622040c48878f1372ed.tar.gz
Merge "LPPe feature support."
-rw-r--r--core/ContextBase.h2
-rw-r--r--core/LocAdapterBase.h6
-rw-r--r--core/LocApiBase.cpp22
-rw-r--r--core/LocApiBase.h12
-rw-r--r--core/gps_extended_c.h7
-rw-r--r--etc/gps.conf14
-rw-r--r--loc_api/libloc_api_50001/LocEngAdapter.h5
-rw-r--r--loc_api/libloc_api_50001/loc_eng.cpp31
-rw-r--r--loc_api/libloc_api_50001/loc_eng.h3
9 files changed, 97 insertions, 5 deletions
diff --git a/core/ContextBase.h b/core/ContextBase.h
index be6b7bb..4f7ac39 100644
--- a/core/ContextBase.h
+++ b/core/ContextBase.h
@@ -59,6 +59,8 @@ typedef struct loc_gps_cfg_s
uint32_t GPS_LOCK;
uint32_t A_GLONASS_POS_PROTOCOL_SELECT;
uint32_t AGPS_CERT_WRITABLE_MASK;
+ uint32_t LPPE_CP_TECHNOLOGY;
+ uint32_t LPPE_UP_TECHNOLOGY;
} loc_gps_cfg_s_type;
/* NOTE: the implementaiton of the parser casts number
diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h
index f92ccee..2c7a2e8 100644
--- a/core/LocAdapterBase.h
+++ b/core/LocAdapterBase.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2011-2014,2016 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
@@ -78,6 +78,10 @@ public:
mLocApi->updateEvtMask();
}
+ inline bool isFeatureSupported(uint8_t featureVal) {
+ return mLocApi->isFeatureSupported(featureVal);
+ }
+
// This will be overridden by the individual adapters
// if necessary.
inline virtual void setUlpProxy(UlpProxyBase* ulp) {
diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp
index 7c11470..bda3dfd 100644
--- a/core/LocApiBase.cpp
+++ b/core/LocApiBase.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2011-2014,2016 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
@@ -132,6 +132,7 @@ LocApiBase::LocApiBase(const MsgTask* msgTask,
mMask(0), mSupportedMsg(0), mContext(context)
{
memset(mLocAdapters, 0, sizeof(mLocAdapters));
+ memset(mFeaturesSupported, 0, sizeof(mFeaturesSupported));
}
LOC_API_ADAPTER_EVENT_MASK_T LocApiBase::getEvtMask()
@@ -356,6 +357,11 @@ void LocApiBase::saveSupportedMsgList(uint64_t supportedMsgList)
mSupportedMsg = supportedMsgList;
}
+void LocApiBase::saveSupportedFeatureList(uint8_t *featureList)
+{
+ memcpy((void *)mFeaturesSupported, (void *)featureList, sizeof(mFeaturesSupported));
+}
+
void* LocApiBase :: getSibling()
DEFAULT_IMPL(NULL)
@@ -491,6 +497,10 @@ enum loc_api_adapter_err LocApiBase::
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
+ setLPPeProtocol(unsigned long lppeCP, unsigned long lppeUP)
+ DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
+
+enum loc_api_adapter_err LocApiBase::
getWwanZppFix(GpsLocation& zppLoc)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
@@ -552,4 +562,14 @@ bool LocApiBase::
gnssConstellationConfig()
DEFAULT_IMPL(false)
+bool LocApiBase::
+ isFeatureSupported(uint8_t featureVal)
+{
+ uint8_t arrayIndex = featureVal >> 3;
+ uint8_t bitPos = featureVal & 7;
+
+ if (arrayIndex >= MAX_FEATURE_LENGTH) return false;
+ return ((mFeaturesSupported[arrayIndex] >> bitPos ) & 0x1);
+}
+
} // namespace loc_core
diff --git a/core/LocApiBase.h b/core/LocApiBase.h
index e92cdaa..372fc74 100644
--- a/core/LocApiBase.h
+++ b/core/LocApiBase.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2011-2014, 2016 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
@@ -44,6 +44,7 @@ int decodeAddress(char *addr_string, int string_size,
const char *data, int data_size);
#define MAX_ADAPTERS 10
+#define MAX_FEATURE_LENGTH 100
#define TO_ALL_ADAPTERS(adapters, call) \
for (int i = 0; i < MAX_ADAPTERS && NULL != (adapters)[i]; i++) { \
@@ -81,6 +82,7 @@ class LocApiBase {
ContextBase *mContext;
LocAdapterBase* mLocAdapters[MAX_ADAPTERS];
uint64_t mSupportedMsg;
+ uint8_t mFeaturesSupported[MAX_FEATURE_LENGTH];
protected:
virtual enum loc_api_adapter_err
@@ -131,6 +133,7 @@ public:
void requestNiNotify(GpsNiNotification &notify, const void* data);
void saveSupportedMsgList(uint64_t supportedMsgList);
void reportGnssMeasurementData(GnssData &gnssMeasurementData);
+ void saveSupportedFeatureList(uint8_t *featureList);
// downward calls
// All below functions are to be defined by adapter specific modules:
@@ -204,6 +207,8 @@ public:
virtual enum loc_api_adapter_err
setAGLONASSProtocol(unsigned long aGlonassProtocol);
virtual enum loc_api_adapter_err
+ setLPPeProtocol(unsigned long lppeCP, unsigned long lppeUP);
+ virtual enum loc_api_adapter_err
getWwanZppFix(GpsLocation & zppLoc);
virtual enum loc_api_adapter_err
getBestAvailableZppFix(GpsLocation & zppLoc);
@@ -258,6 +263,11 @@ public:
Check if the modem support the service
*/
virtual bool gnssConstellationConfig();
+
+ /*
+ Check if a feature is supported
+ */
+ bool isFeatureSupported(uint8_t featureVal);
};
typedef LocApiBase* (getLocApi_t)(const MsgTask* msgTask,
diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h
index 2780ebc..e969d74 100644
--- a/core/gps_extended_c.h
+++ b/core/gps_extended_c.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2015, 2016 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
@@ -87,6 +87,11 @@ enum loc_registration_mask_status {
LOC_REGISTRATION_MASK_DISABLED
};
+typedef enum {
+ LOC_SUPPORTED_FEATURE_ODCPI_2_V02 = 0, /**< Support ODCPI version 2 feature */
+ LOC_SUPPORTED_FEATURE_WIFI_AP_DATA_INJECT_2_V02 /**< Support Wifi AP data inject version 2 feature */
+} loc_supported_feature_enum;
+
typedef struct {
/** set to sizeof(UlpLocation) */
size_t size;
diff --git a/etc/gps.conf b/etc/gps.conf
index f415314..0118813 100644
--- a/etc/gps.conf
+++ b/etc/gps.conf
@@ -109,3 +109,17 @@ SGLTE_TARGET=0
# 0x2: RRLP UPlane
# 0x4: LLP Uplane
A_GLONASS_POS_PROTOCOL_SELECT = 0
+
+##################################################
+# Select technology for LPPe Control Plane
+##################################################
+# 0x1: DBH for LPPe CP
+# 0x2: WLAN AP Measurements for LPPe CP
+LPPE_CP_TECHNOLOGY = 0
+
+##################################################
+# Select technology for LPPe User Plane
+##################################################
+# 0x1: DBH for LPPe UP
+# 0x2: WLAN AP Measurements for LPPe UP
+LPPE_UP_TECHNOLOGY = 0
diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h
index 446acf4..fe79f77 100644
--- a/loc_api/libloc_api_50001/LocEngAdapter.h
+++ b/loc_api/libloc_api_50001/LocEngAdapter.h
@@ -239,6 +239,11 @@ public:
{
return mLocApi->setAGLONASSProtocol(aGlonassProtocol);
}
+ inline virtual enum loc_api_adapter_err
+ setLPPeProtocol(unsigned long lppeCP, unsigned long lppeUP)
+ {
+ return mLocApi->setLPPeProtocol(lppeCP, lppeUP);
+ }
inline virtual int initDataServiceClient()
{
return mLocApi->initDataServiceClient();
diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp
index 2bae27a..4aaee18 100644
--- a/loc_api/libloc_api_50001/loc_eng.cpp
+++ b/loc_api/libloc_api_50001/loc_eng.cpp
@@ -86,6 +86,8 @@ static const loc_param_s_type gps_conf_table[] =
{"SUPL_VER", &gps_conf.SUPL_VER, NULL, 'n'},
{"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'},
{"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'},
+ {"LPPE_CP_TECHNOLOGY", &gps_conf.LPPE_CP_TECHNOLOGY, NULL, 'n'},
+ {"LPPE_UP_TECHNOLOGY", &gps_conf.LPPE_UP_TECHNOLOGY, NULL, 'n'},
{"AGPS_CERT_WRITABLE_MASK", &gps_conf.AGPS_CERT_WRITABLE_MASK, NULL, 'n'},
{"SUPL_MODE", &gps_conf.SUPL_MODE, NULL, 'n'},
{"SUPL_ES", &gps_conf.SUPL_ES, NULL, 'n'},
@@ -140,6 +142,10 @@ static void loc_default_parameters(void)
gps_conf.XTRA_VERSION_CHECK=0;
/*Use emergency PDN by default*/
gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL = 1;
+ /* By default no LPPe CP technology is enabled*/
+ gps_conf.LPPE_CP_TECHNOLOGY = 0;
+ /* By default no LPPe UP technology is enabled*/
+ gps_conf.LPPE_UP_TECHNOLOGY = 0;
/*Defaults for sap.conf*/
sap_conf.GYRO_BIAS_RANDOM_WALK = 0;
@@ -459,6 +465,29 @@ struct LocEngAGlonassProtocol : public LocMsg {
}
};
+
+struct LocEngLPPeProtocol : public LocMsg {
+ LocEngAdapter* mAdapter;
+ const unsigned long mLPPeCP;
+ const unsigned long mLPPeUP;
+ inline LocEngLPPeProtocol(LocEngAdapter* adapter,
+ unsigned long lppeCP, unsigned long lppeUP) :
+ LocMsg(), mAdapter(adapter), mLPPeCP(lppeCP), mLPPeUP(lppeUP)
+ {
+ locallog();
+ }
+ inline virtual void proc() const {
+ mAdapter->setLPPeProtocol(mLPPeCP, mLPPeUP);
+ }
+ inline void locallog() const {
+ LOC_LOGV("LPPe CP: 0x%lx LPPe UP: 0x%1x", mLPPeCP, mLPPeUP);
+ }
+ inline virtual void log() const {
+ locallog();
+ }
+};
+
+
// case LOC_ENG_MSG_SUPL_VERSION:
struct LocEngSuplVer : public LocMsg {
LocEngAdapter* mAdapter;
@@ -1833,6 +1862,8 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data)
adapter->sendMsg(new LocEngSensorControlConfig(adapter, sap_conf.SENSOR_USAGE,
sap_conf.SENSOR_PROVIDER));
adapter->sendMsg(new LocEngAGlonassProtocol(adapter, gps_conf.A_GLONASS_POS_PROTOCOL_SELECT));
+ adapter->sendMsg(new LocEngLPPeProtocol(adapter, gps_conf.LPPE_CP_TECHNOLOGY,
+ gps_conf.LPPE_UP_TECHNOLOGY));
if (!loc_eng_data.generateNmea)
{
diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h
index 1fe1375..c402fac 100644
--- a/loc_api/libloc_api_50001/loc_eng.h
+++ b/loc_api/libloc_api_50001/loc_eng.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2014, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2009-2014, 2016 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
@@ -142,6 +142,7 @@ typedef struct loc_eng_data_s
loc_ext_parser sv_ext_parser;
} loc_eng_data_s_type;
+
//loc_eng functions
int loc_eng_init(loc_eng_data_s_type &loc_eng_data,
LocCallbacks* callbacks,