From 2f527dbb7e1c62e84a1f5f9b06a96b617a46a833 Mon Sep 17 00:00:00 2001 From: Rohit Grover Date: Wed, 16 Dec 2015 08:54:09 +0000 Subject: [PATCH 1/3] transparenly support existing applications which may have used Gap::ADDR_TYPE_*. --- ble/Gap.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ble/Gap.h b/ble/Gap.h index 5e3f31b..ad6e4ce 100644 --- a/ble/Gap.h +++ b/ble/Gap.h @@ -38,9 +38,17 @@ class Gap { public: /** * Address-type for BLEProtocol addresses. - * @note: deprecated. Use BLEProtocol::AddressType_t instead. + * + * @note: deprecated. Use BLEProtocol::AddressType_t instead. This declaration will soon be changed to: + * typedef BLEProtocol::AddressType_t AddressType_t; + * It has been left in this current state to transparenly support existing applications which may have used Gap::ADDR_TYPE_*. */ - typedef BLEProtocol::AddressType_t AddressType_t; + enum AddressType_t { + ADDR_TYPE_PUBLIC = BLEProtocol::AddressType::PUBLIC, + ADDR_TYPE_RANDOM_STATIC, + ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE, + ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE + }; /** * Address-type for BLEProtocol addresses. From f30fe6bcdacd60a8392d26e1ddf16835a7f786fd Mon Sep 17 00:00:00 2001 From: Rohit Grover Date: Wed, 16 Dec 2015 09:07:57 +0000 Subject: [PATCH 2/3] use an anonymous enum instead --- ble/Gap.h | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/ble/Gap.h b/ble/Gap.h index ad6e4ce..0d6eb8a 100644 --- a/ble/Gap.h +++ b/ble/Gap.h @@ -39,15 +39,23 @@ public: /** * Address-type for BLEProtocol addresses. * - * @note: deprecated. Use BLEProtocol::AddressType_t instead. This declaration will soon be changed to: - * typedef BLEProtocol::AddressType_t AddressType_t; - * It has been left in this current state to transparenly support existing applications which may have used Gap::ADDR_TYPE_*. + * @note: deprecated. Use BLEProtocol::AddressType_t instead. + */ + typedef BLEProtocol::AddressType_t AddressType_t; + + /** + * Address-type for BLEProtocol addresses. + * @note: deprecated. Use BLEProtocol::AddressType_t instead. + * + * DEPRECATION ALERT: The following constants have been left in their + * deprecated state to transparenly support existing applications which may + * have used Gap::ADDR_TYPE_*. */ - enum AddressType_t { - ADDR_TYPE_PUBLIC = BLEProtocol::AddressType::PUBLIC, - ADDR_TYPE_RANDOM_STATIC, - ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE, - ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE + enum { + ADDR_TYPE_PUBLIC = BLEProtocol::AddressType::PUBLIC, + ADDR_TYPE_RANDOM_STATIC = BLEProtocol::AddressType::RANDOM_STATIC, + ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE = BLEProtocol::AddressType::RANDOM_PRIVATE_RESOLVABLE, + ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE = BLEProtocol::AddressType::RANDOM_PRIVATE_NON_RESOLVABLE }; /** From 3c15a7dfcc4010d3a8034963fdb89bfab1aad2cd Mon Sep 17 00:00:00 2001 From: Rohit Grover Date: Wed, 16 Dec 2015 09:09:38 +0000 Subject: [PATCH 3/3] minor re-organization --- ble/Gap.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ble/Gap.h b/ble/Gap.h index 0d6eb8a..97e8e41 100644 --- a/ble/Gap.h +++ b/ble/Gap.h @@ -43,6 +43,12 @@ public: */ typedef BLEProtocol::AddressType_t AddressType_t; + /** + * Address-type for BLEProtocol addresses. + * @note: deprecated. Use BLEProtocol::AddressType_t instead. + */ + typedef BLEProtocol::AddressType_t addr_type_t; + /** * Address-type for BLEProtocol addresses. * @note: deprecated. Use BLEProtocol::AddressType_t instead. @@ -58,12 +64,6 @@ public: ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE = BLEProtocol::AddressType::RANDOM_PRIVATE_NON_RESOLVABLE }; - /** - * Address-type for BLEProtocol addresses. - * @note: deprecated. Use BLEProtocol::AddressType_t instead. - */ - typedef BLEProtocol::AddressType_t addr_type_t; - static const unsigned ADDR_LEN = BLEProtocol::ADDR_LEN; /**< Length (in octets) of the BLE MAC address. */ typedef BLEProtocol::Address_t Address_t; /**< 48-bit address, LSB format. @Note: Deprecated. Use BLEProtocol::Address_t instead. */ typedef BLEProtocol::Address_t address_t; /**< 48-bit address, LSB format. @Note: Deprecated. Use BLEProtocol::Address_t instead. */