From 5a43c1e83506076198c3735dbd76bd900ef64bc2 Mon Sep 17 00:00:00 2001 From: takawata Date: Wed, 10 Jun 2020 04:54:02 +0000 Subject: [PATCH] Add LE events: READ_REMOTE_FEATURES_COMPL LONG_TERM_KEY_REQUEST REMOTE_CONN_PARAM_REQUEST DATA_LENGTH_CHANGE READ_LOCAL_P256_PK_COMPL GEN_DHKEY_COMPL ENH_CONN_COMPL PR: 247050 Submitted by: Marc Veldman marc at bumblingdork.com --- sys/netgraph/bluetooth/include/ng_hci.h | 60 +++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/sys/netgraph/bluetooth/include/ng_hci.h b/sys/netgraph/bluetooth/include/ng_hci.h index 9e9cd768bd5..f16cb6b2181 100644 --- a/sys/netgraph/bluetooth/include/ng_hci.h +++ b/sys/netgraph/bluetooth/include/ng_hci.h @@ -1992,11 +1992,65 @@ typedef struct { u_int16_t conn_latency; u_int16_t supervision_timeout; }__attribute__((packed)) ng_hci_connection_update_complete_ep; + #define NG_HCI_LEEV_READ_REMOTE_FEATURES_COMPL 0x04 -//TBD -#define NG_HCI_LEEV_LONG_TERM_KEY_REQUEST 0x05 -//TBD +typedef struct { + u_int8_t status; + u_int16_t connection_handle; + u_int8_t features[NG_HCI_FEATURES_SIZE]; +}__attribute__((packed)) ng_hci_le_read_remote_features_ep; +#define NG_HCI_LEEV_LONG_TERM_KEY_REQUEST 0x05 +typedef struct { + u_int16_t connection_handle; + u_int64_t random_number; + u_int16_t encrypted_diversifier; +}__attribute__((packed)) ng_hci_le_long_term_key_request_ep; + +#define NG_HCI_LEEV_REMOTE_CONN_PARAM_REQUEST 0x06 +typedef struct { + u_int16_t connection_handle; + u_int16_t interval_min; + u_int16_t interval_max; + u_int16_t latency; + u_int16_t timeout; +}__attribute__((packed)) ng_hci_le_remote_conn_param_ep; + +#define NG_HCI_LEEV_DATA_LENGTH_CHANGE 0x07 +typedef struct { + u_int16_t connection_handle; + u_int16_t min_tx_octets; + u_int16_t max_tx_time; + u_int16_t max_rx_octets; + u_int16_t max_rx_time; +}__attribute__((packed)) ng_hci_le_data_length_change_ep; + +#define NG_HCI_LEEV_READ_LOCAL_P256_PK_COMPL 0x08 +typedef struct { + u_int8_t status; + u_int8_t local_p256_pk[64]; +}__attribute__((packed)) ng_hci_le_read_local_p256_pk_compl_ep; + +#define NG_HCI_LEEV_GEN_DHKEY_COMPL 0x09 +typedef struct { + u_int8_t status; + u_int8_t dh_key[32]; +}__attribute__((packed)) ng_hci_le_gen_dhkey_compl_ep; + +#define NG_HCI_LEEV_ENH_CONN_COMPL 0x0a +typedef struct { + u_int8_t status; + u_int16_t connection_handle; + u_int8_t role; + u_int8_t peer_addr_type; + bdaddr_t peer_addr; + bdaddr_t local_res_private_addr; + bdaddr_t peer_res_private_addr; + u_int16_t conn_interval; + u_int16_t conn_latency; + u_int16_t supervision_timeout; + u_int8_t master_clock_accuracy; +}__attribute__((packed)) ng_hci_le_enh_conn_compl_ep; #define NG_HCI_EVENT_BT_LOGO 0xfe -- 2.45.0