diff --git a/src/bluetooth.h b/src/bluetooth.h index 8ec469b78..24bf7f783 100644 --- a/src/bluetooth.h +++ b/src/bluetooth.h @@ -439,6 +439,14 @@ typedef enum { #define HCI_EVENT_READ_REMOTE_SUPPORTED_FEATURES_COMPLETE 0x0B +/** + * @format 12122 + * @param status + * @param connection_handle + * @param version + * @param manufacturer_name + * @param subversion + */ #define HCI_EVENT_READ_REMOTE_VERSION_INFORMATION_COMPLETE 0x0C #define HCI_EVENT_QOS_SETUP_COMPLETE 0x0D diff --git a/src/btstack_event.h b/src/btstack_event.h index 207b29de1..c593aa9fe 100644 --- a/src/btstack_event.h +++ b/src/btstack_event.h @@ -471,6 +471,52 @@ static inline uint8_t hci_event_master_link_key_complete_get_key_flag(const uint return event[5]; } +/** + * @brief Get field status from event HCI_EVENT_READ_REMOTE_VERSION_INFORMATION_COMPLETE + * @param event packet + * @return status + * @note: btstack_type 1 + */ +static inline uint8_t hci_event_read_remote_version_information_complete_get_status(const uint8_t * event){ + return event[2]; +} +/** + * @brief Get field connection_handle from event HCI_EVENT_READ_REMOTE_VERSION_INFORMATION_COMPLETE + * @param event packet + * @return connection_handle + * @note: btstack_type 2 + */ +static inline uint16_t hci_event_read_remote_version_information_complete_get_connection_handle(const uint8_t * event){ + return little_endian_read_16(event, 3); +} +/** + * @brief Get field version from event HCI_EVENT_READ_REMOTE_VERSION_INFORMATION_COMPLETE + * @param event packet + * @return version + * @note: btstack_type 1 + */ +static inline uint8_t hci_event_read_remote_version_information_complete_get_version(const uint8_t * event){ + return event[5]; +} +/** + * @brief Get field manufacturer_name from event HCI_EVENT_READ_REMOTE_VERSION_INFORMATION_COMPLETE + * @param event packet + * @return manufacturer_name + * @note: btstack_type 2 + */ +static inline uint16_t hci_event_read_remote_version_information_complete_get_manufacturer_name(const uint8_t * event){ + return little_endian_read_16(event, 6); +} +/** + * @brief Get field subversion from event HCI_EVENT_READ_REMOTE_VERSION_INFORMATION_COMPLETE + * @param event packet + * @return subversion + * @note: btstack_type 2 + */ +static inline uint16_t hci_event_read_remote_version_information_complete_get_subversion(const uint8_t * event){ + return little_endian_read_16(event, 8); +} + /** * @brief Get field num_hci_command_packets from event HCI_EVENT_COMMAND_COMPLETE * @param event packet diff --git a/src/hci_cmd.c b/src/hci_cmd.c index d498c582f..d86a2aa88 100644 --- a/src/hci_cmd.c +++ b/src/hci_cmd.c @@ -317,13 +317,20 @@ const hci_cmd_t hci_remote_name_request_cancel = { OPCODE(OGF_LINK_CONTROL, 0x1A), "B" }; -/** + /** * @param handle */ const hci_cmd_t hci_read_remote_supported_features_command = { OPCODE(OGF_LINK_CONTROL, 0x1B), "H" }; +/** + * @param handle + */ +const hci_cmd_t hci_read_remote_version_information = { +OPCODE(OGF_LINK_CONTROL, 0x1D), "H" +}; + /** * @param handle * @param transmit_bandwidth 8000(64kbps) diff --git a/src/hci_cmd.h b/src/hci_cmd.h index 34ac2a9b1..10babe594 100644 --- a/src/hci_cmd.h +++ b/src/hci_cmd.h @@ -124,6 +124,7 @@ extern const hci_cmd_t hci_read_local_version_information; extern const hci_cmd_t hci_read_loopback_mode; extern const hci_cmd_t hci_read_num_broadcast_retransmissions; extern const hci_cmd_t hci_read_remote_supported_features_command; +extern const hci_cmd_t hci_read_remote_version_information; extern const hci_cmd_t hci_read_rssi; extern const hci_cmd_t hci_reject_connection_request; extern const hci_cmd_t hci_remote_name_request;