diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2016-06-21 00:41:28 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-06-21 00:41:28 -0700 |
commit | 17e8653d96a957b6a163a622040c48878f1372ed (patch) | |
tree | f14d6bb0619d9281c3eb3c35c75aa77f98ab2a18 /core | |
parent | 023ea00a29c7e7d5fdc9fa5b315adcb911e01aa0 (diff) | |
parent | 310aa84028c4d8953f2be04131a9a0ed1d258bd8 (diff) | |
download | gps-17e8653d96a957b6a163a622040c48878f1372ed.tar.gz |
Merge "LPPe feature support."
Diffstat (limited to 'core')
-rw-r--r-- | core/ContextBase.h | 2 | ||||
-rw-r--r-- | core/LocAdapterBase.h | 6 | ||||
-rw-r--r-- | core/LocApiBase.cpp | 22 | ||||
-rw-r--r-- | core/LocApiBase.h | 12 | ||||
-rw-r--r-- | core/gps_extended_c.h | 7 |
5 files changed, 45 insertions, 4 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 ¬ify, 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; |