diff --git a/src/bluetooth.h b/src/bluetooth.h index afe89ce9c..8f7423e2c 100644 --- a/src/bluetooth.h +++ b/src/bluetooth.h @@ -276,7 +276,6 @@ typedef enum { * @param status */ #define HCI_EVENT_INQUIRY_COMPLETE 0x01 -// no format yet, can contain multiple results /** * @format 1B11132 @@ -346,8 +345,11 @@ typedef enum { * @param key_flag */ #define HCI_EVENT_MASTER_LINK_KEY_COMPLETE 0x0A + #define HCI_EVENT_READ_REMOTE_SUPPORTED_FEATURES_COMPLETE 0x0B + #define HCI_EVENT_READ_REMOTE_VERSION_INFORMATION_COMPLETE 0x0C + #define HCI_EVENT_QOS_SETUP_COMPLETE 0x0D /** @@ -371,7 +373,7 @@ typedef enum { */ #define HCI_EVENT_HARDWARE_ERROR 0x10 -#define HCI_EVENT_FLUSH_OCCURED 0x11 +#define HCI_EVENT_FLUSH_OCCURRED 0x11 /** * @format 1B1 @@ -489,9 +491,31 @@ typedef enum { #define HCI_EVENT_IO_CAPABILITY_REQUEST 0x31 #define HCI_EVENT_IO_CAPABILITY_RESPONSE 0x32 + +/** + * @format B4 + * @param bd_addr + * @param numeric_value + */ #define HCI_EVENT_USER_CONFIRMATION_REQUEST 0x33 + +/** + * @format B + * @param bd_addr + */ #define HCI_EVENT_USER_PASSKEY_REQUEST 0x34 + +/** + * @format B + * @param bd_addr + */ #define HCI_EVENT_REMOTE_OOB_DATA_REQUEST 0x35 + +/** + * @format 1B + * @param status + * @param bd_addr + */ #define HCI_EVENT_SIMPLE_PAIRING_COMPLETE 0x36 #define HCI_EVENT_LE_META 0x3E diff --git a/src/btstack_event.h b/src/btstack_event.h index b8eefc5d2..018689650 100644 --- a/src/btstack_event.h +++ b/src/btstack_event.h @@ -864,6 +864,64 @@ static inline hci_con_handle_t hci_event_encryption_key_refresh_complete_get_han return little_endian_read_16(event, 3); } +/** + * @brief Get field bd_addr from event HCI_EVENT_USER_CONFIRMATION_REQUEST + * @param event packet + * @param Pointer to storage for bd_addr + * @note: btstack_type B + */ +static inline void hci_event_user_confirmation_request_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ + reverse_bd_addr(&event[2], bd_addr); +} +/** + * @brief Get field numeric_value from event HCI_EVENT_USER_CONFIRMATION_REQUEST + * @param event packet + * @return numeric_value + * @note: btstack_type 4 + */ +static inline uint32_t hci_event_user_confirmation_request_get_numeric_value(const uint8_t * event){ + return little_endian_read_32(event, 8); +} + +/** + * @brief Get field bd_addr from event HCI_EVENT_USER_PASSKEY_REQUEST + * @param event packet + * @param Pointer to storage for bd_addr + * @note: btstack_type B + */ +static inline void hci_event_user_passkey_request_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ + reverse_bd_addr(&event[2], bd_addr); +} + +/** + * @brief Get field bd_addr from event HCI_EVENT_REMOTE_OOB_DATA_REQUEST + * @param event packet + * @param Pointer to storage for bd_addr + * @note: btstack_type B + */ +static inline void hci_event_remote_oob_data_request_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ + reverse_bd_addr(&event[2], bd_addr); +} + +/** + * @brief Get field status from event HCI_EVENT_SIMPLE_PAIRING_COMPLETE + * @param event packet + * @return status + * @note: btstack_type 1 + */ +static inline uint8_t hci_event_simple_pairing_complete_get_status(const uint8_t * event){ + return event[2]; +} +/** + * @brief Get field bd_addr from event HCI_EVENT_SIMPLE_PAIRING_COMPLETE + * @param event packet + * @param Pointer to storage for bd_addr + * @note: btstack_type B + */ +static inline void hci_event_simple_pairing_complete_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){ + reverse_bd_addr(&event[3], bd_addr); +} + /** * @brief Get field state from event BTSTACK_EVENT_STATE * @param event packet