hci: add hci_read_remote_version_information and corresponding hci_event_read_remote_version_information_complete

This commit is contained in:
Matthias Ringwald 2019-03-28 10:49:54 +01:00
parent a63a688a17
commit 8b22c04ddc
4 changed files with 63 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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;