From 2989466b01c4069512cf3bd7a59cb54a89a9d54b Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Tue, 31 Mar 2020 12:09:15 +0100 Subject: [PATCH] BLE: construct disconnection_reason_t from uint8_t (received from HCI) --- features/FEATURE_BLE/ble/gap/Types.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/features/FEATURE_BLE/ble/gap/Types.h b/features/FEATURE_BLE/ble/gap/Types.h index 230bcd0009..f728ef6c45 100644 --- a/features/FEATURE_BLE/ble/gap/Types.h +++ b/features/FEATURE_BLE/ble/gap/Types.h @@ -854,6 +854,17 @@ struct disconnection_reason_t : SafeEnum { disconnection_reason_t(type value) : SafeEnum(value) { } + + /** + * Construct a new instance of disconnection_reason_t. + * + * @param value The value of the local_disconnection_reason_t created. + * + * @note This should only be used for casting raw values from HCI. + */ + disconnection_reason_t(uint8_t value) : SafeEnum(value) + { + } }; /** @@ -917,7 +928,7 @@ struct peripheral_privacy_configuration_t { * @note This configuration is also used when the local device operates as * an observer. */ -struct central_privay_configuration_t { +struct central_privacy_configuration_t { /** * Indicates if nonresolvable random address should be used when the * central or observer sends scan request packets.