#define HCI_ADVERT_DATA_SIZE 31
#define HCI_SCAN_DATA_SIZE 31
#define HCI_LE_EVMSK_ALL 0x000000000000001f
#define HCI_LE_EVMSK_NONE 0x0000000000000000
#define HCI_LE_EVMSK_CON_COMPL 0x0000000000000001
#define HCI_LE_EVMSK_ADV_REPORT 0x0000000000000002
#define HCI_LE_EVMSK_CON_UPDATE_COMPL 0x0000000000000004
#define HCI_LE_EVMSK_READ_REMOTE_FEATURES_COMPL 0x0000000000000008
#define HCI_LE_EVMSK_LONG_TERM_KEY_REQ 0x0000000000000010
#define HCI_OGF_LE 0x08
#define HCI_OCF_LE_SET_EVENT_MASK 0x0001
#define HCI_CMD_LE_SET_EVENT_MASK 0x2001
typedef struct {
uint8_t event_mask[HCI_EVENT_MASK_SIZE];
} __packed hci_le_set_event_mask_cp;
typedef hci_status_rp hci_le_set_event_mask_rp;
#define HCI_OCF_LE_READ_BUFFER_SIZE 0x0002
#define HCI_CMD_LE_READ_BUFFER_SIZE 0x2002
typedef struct {
uint8_t status;
uint16_t le_data_pktlen;
uint8_t le_num_pkts;
} __packed hci_le_read_buffer_size_rp;
#define HCI_OCF_LE_READ_LOCAL_FEATURES 0x0003
#define HCI_CMD_LE_READ_LOCAL_FEATURES 0x2003
typedef struct {
uint8_t status;
uint8_t features[HCI_FEATURES_SIZE];
} __packed hci_le_read_local_features_rp;
#define HCI_OCF_LE_SET_RND_ADDR 0x0005
#define HCI_CMD_LE_SET_RND_ADDR 0x2005
typedef struct {
bdaddr_t bdaddr;
} __packed hci_le_set_rnd_addr_cp;
typedef hci_status_rp hci_le_set_rnd_addr_rp;
#define HCI_OCF_LE_SET_ADVERT_PARAM 0x0006
#define HCI_CMD_LE_SET_ADVERT_PARAM 0x2006
typedef struct {
uint16_t min_interval;
uint16_t max_interval;
uint8_t advert_type;
uint8_t own_address_type;
uint8_t direct_address_type;
bdaddr_t direct_address;
uint8_t advert_channel_map;
uint8_t advert_filter_policy;
} __packed hci_le_set_advert_param_cp;
typedef hci_status_rp hci_le_set_advert_param_rp;
#define HCF_OCF_LE_READ_ADVERT_CHAN_TX_PWR 0x0007
#define HCF_CMD_LE_READ_ADVERT_CHAN_TX_PWR 0x2007
typedef struct {
uint8_t status;
int8_t tx_power_level;
} __packed hci_le_read_advert_chan_tx_pwr_rp;
#define HCF_OCF_LE_SET_ADVERT_DATA 0x0008
#define HCF_CMD_LE_SET_ADVERT_DATA 0x2008
typedef struct {
uint8_t advert_data_len;
uint8_t advert_data[HCI_ADVERT_DATA_SIZE];
} __packed hci_le_set_advert_data_cp;
typedef hci_status_rp hci_le_set_advert_data_rp;
#define HCF_OCF_LE_SET_SCAN_RESP_DATA 0x0009
#define HCF_CMD_LE_SET_SCAN_RESP_DATA 0x2009
typedef struct {
uint8_t scan_resp_data_len;
uint8_t scan_resp_data[HCI_SCAN_DATA_SIZE];
} __packed hci_le_set_scan_resp_data_cp;
typedef hci_status_rp hci_le_set_scan_resp_data_rp;
#define HCF_OCF_LE_SET_ADVERT_ENABLE 0x000a
#define HCF_CMD_LE_SET_ADVERT_ENABLE 0x200A
typedef struct {
uint8_t advert_enable;
} __packed hci_le_set_advert_enable_cp;
typedef hci_status_rp hci_le_set_advert_enable_rp;
#define HCI_OCF_LE_SET_SCAN_PARAM 0x000b
#define HCI_CMD_LE_SET_SCAN_PARAM 0x200B
typedef struct {
uint8_t scan_type;
uint16_t scan_interval;
uint16_t scan_window;
uint8_t own_address_type;
uint8_t scan_filter_policy;
} __packed hci_le_set_scan_param_cp;
typedef hci_status_rp hci_le_set_scan_param_rp;
#define HCF_OCF_LE_SET_SCAN_ENABLE 0x000c
#define HCF_CMD_LE_SET_SCAN_ENABLE 0x200C
typedef struct {
uint8_t scan_enable;
uint8_t filter_dup;
} __packed hci_le_set_scan_enable_cp;
typedef hci_status_rp hci_le_set_scan_enable_rp;
#define HCI_OCF_CREATE_CON_LE 0x000d
#define HCI_CMD_CREATE_CON_LE 0x200D
typedef struct {
uint16_t scan_interval;
uint16_t scan_window;
uint8_t initiator_filter_policy;
uint8_t peer_address_type;
bdaddr_t peer_address;
uint8_t own_address_type;
uint16_t con_interval_min;
uint16_t con_interval_max;
uint16_t con_latency;
uint16_t supervision_timo;
uint16_t min_ce_length;
uint16_t max_ce_length;
} __packed hci_create_con_le_cp;
#define HCI_OCF_CREATE_CON_LE_CANCEL 0x000e
#define HCI_CMD_CREATE_CON_LE_CANCEL 0x200E
typedef hci_status_rp hci_create_con_le_cancel_rp;
#define HCI_OCF_LE_READ_WHITE_LIST_SIZE 0x000f
#define HCI_CMD_LE_READ_WHITE_LIST_SIZE 0x200F
typedef struct {
uint8_t status;
uint8_t white_list_size;
} __packed hci_le_read_white_list_size_rp;
#define HCI_OCF_LE_CLEAR_WHITE_LIST 0x0010
#define HCI_CMD_LE_CLEAR_WHITE_LIST 0x2010
typedef hci_status_rp hci_le_clear_white_list_rp;
#define HCI_OCF_LE_ADD_DEV_TO_WHITE_LIST 0x0011
#define HCI_CMD_LE_ADD_DEV_TO_WHITE_LIST 0x2011
typedef struct {
uint8_t address_type;
bdaddr_t address;
} __packed hci_le_add_dev_to_white_list_cp;
typedef hci_status_rp hci_le_add_dev_to_white_list_rp;
#define HCI_OCF_LE_REMOVE_DEV_FROM_WHITE_LIST 0x0012
#define HCI_CMD_LE_REMOVE_DEV_FROM_WHITE_LIST 0x2012
typedef struct {
uint8_t address_type;
bdaddr_t address;
} __packed hci_le_remove_dev_from_white_list_cp;
typedef hci_status_rp hci_le_remove_dev_from_white_list_rp;
#define HCI_OCF_UPDATE_CON_LE 0x0013
#define HCI_CMD_UPDATE_CON_LE 0x2013
typedef struct {
uint16_t con_handle;
uint16_t con_interval_min;
uint16_t con_interval_max;
uint16_t con_latency;
uint16_t supervision_timo;
uint16_t min_ce_length;
uint16_t max_ce_length;
} __packed hci_update_con_le_cp;
#define HCI_OCF_LE_SET_HOST_CHAN_CLASSIFICATION 0x0014
#define HCI_CMD_LE_SET_HOST_CHAN_CLASSIFICATION 0x2014
typedef struct {
uint8_t map[5];
} __packed hci_le_set_host_chan_classification_cp;
typedef hci_status_rp hci_le_set_host_chan_classification_rp;
#define HCI_OCF_LE_READ_CHANNEL_MAP 0x0015
#define HCI_CMD_LE_READ_CHANNEL_MAP 0x2015
typedef struct {
uint16_t con_handle;
} __packed hci_le_read_channel_map_cp;
typedef struct {
uint8_t status;
uint16_t con_handle;
uint8_t map[5];
} __packed hci_le_read_channel_map_rp;
#define HCI_OCF_LE_READ_REMOTE_FEATURES 0x0016
#define HCI_CMD_LE_READ_REMOTE_FEATURES 0x2016
typedef struct {
uint16_t con_handle;
} __packed hci_le_read_remote_features_cp;
#define HCI_OCF_LE_ENCRYPT 0x0017
#define HCI_CMD_LE_ENCRYPT 0x2017
typedef struct {
uint8_t key[16];
uint8_t plaintext_data[16];
} __packed hci_le_encrypt_cp;
typedef struct {
uint8_t status;
uint16_t enc_data[16];
} __packed hci_le_encrypt_rp;
#define HCI_OCF_LE_RAND 0x0018
#define HCI_CMD_LE_RAND 0x2018
typedef struct {
uint8_t status;
uint8_t rand_num[8];
} __packed hci_le_rand_rp;
#define HCI_OCF_LE_START_ENCRYPT 0x0019
#define HCI_CMD_LE_START_ENCRYPT 0x2019
typedef struct {
uint16_t con_handle;
uint8_t rand_num[8];
uint16_t enc_diversifier;
uint8_t key[HCI_KEY_SIZE];
} __packed hci_le_start_encrypt_cp;
#define HCI_OCF_LE_LONG_TERM_KEY_REQ_REP 0x001a
#define HCI_CMD_LE_LONG_TERM_KEY_REQ_REP 0x201A
typedef struct {
uint16_t con_handle;
uint8_t key[HCI_KEY_SIZE];
} __packed hci_le_long_term_key_req_rep_cp;
typedef struct {
uint8_t status;
uint16_t con_handle;
} __packed hci_le_long_term_key_req_rep_rp;
#define HCI_OCF_LE_LONG_TERM_KEY_REQ_REP_NEG 0x001b
#define HCI_CMD_LE_LONG_TERM_KEY_REQ_REP_NEG 0x201B
typedef struct {
uint16_t con_handle;
} __packed hci_le_long_term_key_req_rep_neg_cp;
typedef struct {
uint8_t status;
uint16_t con_handle;
} __packed hci_le_long_term_key_req_rep_neg_rp;
#define HCI_OCF_LE_RECEIVER_TEST 0x001d
#define HCI_CMD_LE_RECEIVER_TEST 0x201D
typedef struct {
uint8_t rx_freq;
} __packed hci_le_receiver_test_cp;
typedef struct {
uint8_t status;
} __packed hci_le_receiver_test_rp;
#define HCI_OCF_LE_TRANSMITTER_TEST 0x001e
#define HCI_CMD_LE_TRANSMITTER_TEST 0x201E
typedef struct {
uint8_t tx_freq;
uint8_t test_len;
uint8_t payload;
} __packed hci_le_transmitter_test_cp;
typedef struct {
uint8_t status;
} __packed hci_le_transmitter_test_rp;
#define HCI_OCF_LE_TEST_END 0x001f
#define HCI_CMD_LE_TEST_END 0x201F
typedef struct {
uint8_t status;
uint16_t num_pkts;
} __packed hci_le_test_end_rp;
#define HCI_LE_META_EVENT 0x3e
#define HCI_SUBEVT_CON_COMP 0x01
typedef struct {
uint8_t subevt_code;
uint8_t status;
uint16_t con_handle;
uint8_t role;
uint8_t peer_address_type;
bdaddr_t peer_address;
uint8_t own_address_type;
uint16_t con_interval;
uint16_t con_latency;
uint8_t master_clk_accuracy;
} __packed hci_le_con_comp_ep;