diff --git a/connectivity/FEATURE_BLE/include/ble/BLE.h b/connectivity/FEATURE_BLE/include/ble/BLE.h index b84070d32b..6bb7eddbcd 100644 --- a/connectivity/FEATURE_BLE/include/ble/BLE.h +++ b/connectivity/FEATURE_BLE/include/ble/BLE.h @@ -28,16 +28,15 @@ #include "ble/types/BLETypes.h" #include "ble/types/blecommon.h" +#include "ble/Gap.h" +#include "ble/GattClient.h" +#include "ble/GattServer.h" +#include "ble/SecurityManager.h" /* Forward declaration for the implementation class */ namespace ble { class BLEInstanceBase; -class Gap; -class GattClient; -class GattServer; -class SecurityManager; -} /** * @addtogroup ble @@ -188,9 +187,10 @@ public: * @return A reference to a single object. * * @pre id shall be less than NUM_INSTANCES. - * @deprecated BLE singleton supports one instance. You may create multiple instances by using the constructor. - * Please use BLE::Instance(). + * */ + MBED_DEPRECATED_SINCE("mbed-os-6.3.0", "BLE singleton supports one instance. You may create multiple" + "instances by using the constructor. Please use BLE::Instance().") static BLE &Instance(InstanceID_t id) { return Instance(); @@ -200,8 +200,9 @@ public: * Fetch the ID of a BLE instance. * * @return Instance id of this BLE instance. - * @deprecated BLE singleton supports one instance. You may create multiple instances by using the constructor. */ + MBED_DEPRECATED_SINCE("mbed-os-6.3.0", "BLE singleton supports one instance. You may create multiple" + "instances by using the constructor.") InstanceID_t getInstanceID(void) const { return DEFAULT_INSTANCE; @@ -475,6 +476,9 @@ private: bool event_signaled; }; +} + +using ble::BLE; /** * @namespace ble Entry namespace for all %BLE API definitions. */ diff --git a/connectivity/FEATURE_BLE/include/ble/types/CallChainOfFunctionPointersWithContext.h b/connectivity/FEATURE_BLE/include/ble/CallChainOfFunctionPointersWithContext.h similarity index 100% rename from connectivity/FEATURE_BLE/include/ble/types/CallChainOfFunctionPointersWithContext.h rename to connectivity/FEATURE_BLE/include/ble/CallChainOfFunctionPointersWithContext.h diff --git a/connectivity/FEATURE_BLE/include/ble/internal/FunctionPointerWithContext.h b/connectivity/FEATURE_BLE/include/ble/FunctionPointerWithContext.h similarity index 100% rename from connectivity/FEATURE_BLE/include/ble/internal/FunctionPointerWithContext.h rename to connectivity/FEATURE_BLE/include/ble/FunctionPointerWithContext.h diff --git a/connectivity/FEATURE_BLE/include/ble/Gap.h b/connectivity/FEATURE_BLE/include/ble/Gap.h index 5f34695f9b..52530bcbe0 100644 --- a/connectivity/FEATURE_BLE/include/ble/Gap.h +++ b/connectivity/FEATURE_BLE/include/ble/Gap.h @@ -555,7 +555,7 @@ public: /** * Preferred connection parameter display in Generic Access Service. */ - typedef struct PreferredConnectionParams_t { + typedef struct { /** * Minimum interval between two connection events allowed for a * connection. diff --git a/connectivity/FEATURE_BLE/include/ble/GattServer.h b/connectivity/FEATURE_BLE/include/ble/GattServer.h index 57a603b364..1ed51aca01 100644 --- a/connectivity/FEATURE_BLE/include/ble/GattServer.h +++ b/connectivity/FEATURE_BLE/include/ble/GattServer.h @@ -31,17 +31,7 @@ #include "ble/Gap.h" #include "SecurityManager.h" -#include "ble/BLE.h" - -/*! Maximum count of characteristics that can be stored for authorisation purposes */ -#define MAX_CHARACTERISTIC_AUTHORIZATION_CNT 20 - -/*! client characteristic configuration descriptors settings */ -#define MAX_CCCD_CNT 20 - namespace ble { -class PalAttClient; -class BLE; /** * @addtogroup ble diff --git a/connectivity/FEATURE_BLE/include/ble/SecurityManager.h b/connectivity/FEATURE_BLE/include/ble/SecurityManager.h index c18dcb7ac9..be42c5d982 100644 --- a/connectivity/FEATURE_BLE/include/ble/SecurityManager.h +++ b/connectivity/FEATURE_BLE/include/ble/SecurityManager.h @@ -25,9 +25,7 @@ #include "ble/types/BLETypes.h" #include "ble/types/blecommon.h" -#include "ble/Gap.h" -#include "ble/internal/GapTypes.h" #include "ble/types/BLETypes.h" #include "ble/internal/SecurityDb.h" #include "ble/internal/PalConnectionMonitor.h" @@ -668,34 +666,6 @@ public: */ ble_error_t setHintFutureRoleReversal(bool enable = true); - /** - * Set the time after which an event will be generated unless we received a packet with - * a valid MIC. - * - * @param[in] connectionHandle Handle to identify the connection. - * @param[in] timeout_in_ms Timeout to set. - * - * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. - */ - ble_error_t setAuthenticationTimeout( - connection_handle_t connection, - uint32_t timeout_in_ms - ); - - /** - * Get the time after which an event will be generated unless we received a packet with - * a valid MIC. - * - * @param[in] connectionHandle Handle to identify the connection. - * @param[in] timeout_in_ms Returns the timeout. - * - * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. - */ - ble_error_t getAuthenticationTimeout( - connection_handle_t connection, - uint32_t *timeout_in_ms - ); - //////////////////////////////////////////////////////////////////////////// // Encryption // @@ -921,15 +891,9 @@ public: public: #if !defined(DOXYGEN_ONLY) - /** For backwards compatibility. This enm is now in BLETypes.h - * @deprecated, use the enum in ble namespace */ - enum Keypress_t { - KEYPRESS_STARTED, /**< Passkey entry started */ - KEYPRESS_ENTERED, /**< Passkey digit entered */ - KEYPRESS_ERASED, /**< Passkey digit erased */ - KEYPRESS_CLEARED, /**< Passkey cleared */ - KEYPRESS_COMPLETED, /**< Passkey entry completed */ - }; + /** For backwards compatibility. This enum is now in BLETypes.h + * @deprecated use the enum in ble namespace */ + typedef ble::Keypress_t Keypress_t; #endif // !defined(DOXYGEN_ONLY) }; diff --git a/connectivity/FEATURE_BLE/include/ble/internal/BLEInstanceBase.h b/connectivity/FEATURE_BLE/include/ble/internal/BLEInstanceBase.h index befdadc66e..041d2161ab 100644 --- a/connectivity/FEATURE_BLE/include/ble/internal/BLEInstanceBase.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/BLEInstanceBase.h @@ -27,11 +27,6 @@ namespace ble { -class SecurityManager; -class Gap; -class GattClient; -class GattServer; - /** * @addtogroup ble * @{ diff --git a/connectivity/FEATURE_BLE/include/ble/types/DiscoveredCharacteristic.h b/connectivity/FEATURE_BLE/include/ble/types/DiscoveredCharacteristic.h index 1935ad65eb..064bfa411d 100644 --- a/connectivity/FEATURE_BLE/include/ble/types/DiscoveredCharacteristic.h +++ b/connectivity/FEATURE_BLE/include/ble/types/DiscoveredCharacteristic.h @@ -21,6 +21,7 @@ #include "ble/types/UUID.h" #include "ble/types/GattAttribute.h" +#include "ble/types/GattCallbackParamTypes.h" #include "ble/types/CharacteristicDescriptorDiscovery.h" #include "ble/types/DiscoveredCharacteristicDescriptor.h" diff --git a/connectivity/FEATURE_BLE/include/ble/types/DiscoveredCharacteristicDescriptor.h b/connectivity/FEATURE_BLE/include/ble/types/DiscoveredCharacteristicDescriptor.h index a35daad625..2cb586a819 100644 --- a/connectivity/FEATURE_BLE/include/ble/types/DiscoveredCharacteristicDescriptor.h +++ b/connectivity/FEATURE_BLE/include/ble/types/DiscoveredCharacteristicDescriptor.h @@ -22,9 +22,12 @@ #include "ble/types/UUID.h" #include "ble/Gap.h" #include "ble/types/GattAttribute.h" -#include "ble/GattClient.h" #include "ble/types/CharacteristicDescriptorDiscovery.h" +namespace ble { +class GattClient; +} + /** * @addtogroup ble * @{ diff --git a/connectivity/FEATURE_BLE/include/ble/types/GattCallbackParamTypes.h b/connectivity/FEATURE_BLE/include/ble/types/GattCallbackParamTypes.h index b49281278c..90e1b90813 100644 --- a/connectivity/FEATURE_BLE/include/ble/types/GattCallbackParamTypes.h +++ b/connectivity/FEATURE_BLE/include/ble/types/GattCallbackParamTypes.h @@ -15,6 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "CallChainOfFunctionPointersWithContext.h" #ifndef MBED_BLE_GATT_CALLBACK_PARAM_TYPES_H__ #define MBED_BLE_GATT_CALLBACK_PARAM_TYPES_H__ diff --git a/connectivity/FEATURE_BLE/include/ble/types/GattCharacteristic.h b/connectivity/FEATURE_BLE/include/ble/types/GattCharacteristic.h index a6620e8f53..5d87cf62d7 100644 --- a/connectivity/FEATURE_BLE/include/ble/types/GattCharacteristic.h +++ b/connectivity/FEATURE_BLE/include/ble/types/GattCharacteristic.h @@ -21,7 +21,6 @@ #include "FunctionPointerWithContext.h" -#include "ble/Gap.h" #include "ble/types/GattAttribute.h" #include "ble/types/GattCallbackParamTypes.h" diff --git a/connectivity/FEATURE_BLE/include/ble/types/ServiceDiscovery.h b/connectivity/FEATURE_BLE/include/ble/types/ServiceDiscovery.h index 5d590a8d5e..0acc7e7fe8 100644 --- a/connectivity/FEATURE_BLE/include/ble/types/ServiceDiscovery.h +++ b/connectivity/FEATURE_BLE/include/ble/types/ServiceDiscovery.h @@ -21,7 +21,6 @@ #include "ble/types/blecommon.h" #include "ble/types/UUID.h" -#include "ble/Gap.h" #include "ble/types/GattAttribute.h" class DiscoveredService; diff --git a/connectivity/FEATURE_BLE/libraries/ble-api-implementation/include/ble/internal/SecurityManagerImpl.h b/connectivity/FEATURE_BLE/libraries/ble-api-implementation/include/ble/internal/SecurityManagerImpl.h index 0e2cdde478..33384276b4 100644 --- a/connectivity/FEATURE_BLE/libraries/ble-api-implementation/include/ble/internal/SecurityManagerImpl.h +++ b/connectivity/FEATURE_BLE/libraries/ble-api-implementation/include/ble/internal/SecurityManagerImpl.h @@ -34,10 +34,11 @@ #include "ble/internal/PalSigningMonitor.h" #include "ble/internal/PalSecurityManager.h" #include "ble/SecurityManager.h" -#include "ble/internal/BLEInstanceBase.h" namespace ble { +class BLEInstanceBase; + class SecurityManager : public ble::interface::SecurityManager, public ble::PalSecurityManagerEventHandler, @@ -118,16 +119,6 @@ public: ble_error_t setHintFutureRoleReversal(bool enable = true); - ble_error_t setAuthenticationTimeout( - connection_handle_t connection, - uint32_t timeout_in_ms - ); - - ble_error_t getAuthenticationTimeout( - connection_handle_t connection, - uint32_t *timeout_in_ms - ); - //////////////////////////////////////////////////////////////////////////// // Encryption // @@ -196,6 +187,35 @@ public: /* ===================================================================== */ /* private implementation follows */ +private: + /** + * Set the time after which an event will be generated unless we received a packet with + * a valid MIC. + * + * @param[in] connectionHandle Handle to identify the connection. + * @param[in] timeout_in_ms Timeout to set. + * + * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. + */ + ble_error_t setAuthenticationTimeout( + connection_handle_t connection, + uint32_t timeout_in_ms + ); + + /** + * Get the time after which an event will be generated unless we received a packet with + * a valid MIC. + * + * @param[in] connectionHandle Handle to identify the connection. + * @param[in] timeout_in_ms Returns the timeout. + * + * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. + */ + ble_error_t getAuthenticationTimeout( + connection_handle_t connection, + uint32_t *timeout_in_ms + ); + /* implements PalSecurityManager::EventHandler */ private: ////////////////////////////////////////////////////////////////////////////