mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-31 10:20:58 +00:00
hci: track HCI_EVENT_IO_CAPABILITY_RESPONSE received
This commit is contained in:
parent
c9f0088dec
commit
2ff4272d8d
@ -2709,6 +2709,7 @@ static void event_handler(uint8_t *packet, uint16_t size){
|
|||||||
hci_event_io_capability_response_get_bd_addr(packet, addr);
|
hci_event_io_capability_response_get_bd_addr(packet, addr);
|
||||||
conn = hci_connection_for_bd_addr_and_type(addr, BD_ADDR_TYPE_ACL);
|
conn = hci_connection_for_bd_addr_and_type(addr, BD_ADDR_TYPE_ACL);
|
||||||
if (!conn) break;
|
if (!conn) break;
|
||||||
|
hci_add_connection_flags_for_flipped_bd_addr(&packet[2], RECV_IO_CAPABILITIES_RESPONSE);
|
||||||
conn->io_cap_response_auth_req = hci_event_io_capability_response_get_authentication_requirements(packet);
|
conn->io_cap_response_auth_req = hci_event_io_capability_response_get_authentication_requirements(packet);
|
||||||
conn->io_cap_response_io = hci_event_io_capability_response_get_io_capability(packet);
|
conn->io_cap_response_io = hci_event_io_capability_response_get_io_capability(packet);
|
||||||
break;
|
break;
|
||||||
@ -4447,7 +4448,9 @@ static bool hci_run_general_pending_commands(void){
|
|||||||
connectionClearAuthenticationFlags(connection, SEND_IO_CAPABILITIES_REPLY);
|
connectionClearAuthenticationFlags(connection, SEND_IO_CAPABILITIES_REPLY);
|
||||||
// set authentication requirements:
|
// set authentication requirements:
|
||||||
// - MITM = ssp_authentication_requirement (USER) | requested_security_level (dynamic)
|
// - MITM = ssp_authentication_requirement (USER) | requested_security_level (dynamic)
|
||||||
// - BONDING MODE: Dedicated if requested, otherwise bondable flag
|
// - BONDING MODE:
|
||||||
|
// - initiator: dedicated if requested, bondable otherwise
|
||||||
|
// - responder: local & remote bondable
|
||||||
uint8_t authreq = hci_stack->ssp_authentication_requirement & 1;
|
uint8_t authreq = hci_stack->ssp_authentication_requirement & 1;
|
||||||
if (gap_mitm_protection_required_for_security_level(connection->requested_security_level)){
|
if (gap_mitm_protection_required_for_security_level(connection->requested_security_level)){
|
||||||
authreq |= 1;
|
authreq |= 1;
|
||||||
|
23
src/hci.h
23
src/hci.h
@ -206,25 +206,26 @@ typedef enum {
|
|||||||
RECV_LINK_KEY_NOTIFICATION = 0x0010,
|
RECV_LINK_KEY_NOTIFICATION = 0x0010,
|
||||||
DENY_PIN_CODE_REQUEST = 0x0040,
|
DENY_PIN_CODE_REQUEST = 0x0040,
|
||||||
RECV_IO_CAPABILITIES_REQUEST = 0x0080,
|
RECV_IO_CAPABILITIES_REQUEST = 0x0080,
|
||||||
SEND_IO_CAPABILITIES_REPLY = 0x0100,
|
RECV_IO_CAPABILITIES_RESPONSE = 0x0100,
|
||||||
SEND_IO_CAPABILITIES_NEGATIVE_REPLY = 0x0200,
|
SEND_IO_CAPABILITIES_REPLY = 0x0200,
|
||||||
SEND_USER_CONFIRM_REPLY = 0x0400,
|
SEND_IO_CAPABILITIES_NEGATIVE_REPLY = 0x0400,
|
||||||
SEND_USER_PASSKEY_REPLY = 0x0800,
|
SEND_USER_CONFIRM_REPLY = 0x0800,
|
||||||
|
SEND_USER_PASSKEY_REPLY = 0x1000,
|
||||||
|
|
||||||
// Classic OOB
|
// Classic OOB
|
||||||
SEND_REMOTE_OOB_DATA_REPLY = 0x1800,
|
SEND_REMOTE_OOB_DATA_REPLY = 0x2000,
|
||||||
|
|
||||||
// pairing status
|
// pairing status
|
||||||
LEGACY_PAIRING_ACTIVE = 0x2000,
|
LEGACY_PAIRING_ACTIVE = 0x4000,
|
||||||
SSP_PAIRING_ACTIVE = 0x4000,
|
SSP_PAIRING_ACTIVE = 0x8000,
|
||||||
|
|
||||||
// connection status
|
// connection status
|
||||||
CONNECTION_AUTHENTICATED = 0x8000,
|
CONNECTION_AUTHENTICATED = 0x10000,
|
||||||
CONNECTION_ENCRYPTED = 0x10000,
|
CONNECTION_ENCRYPTED = 0x20000,
|
||||||
|
|
||||||
// errands
|
// errands
|
||||||
READ_RSSI = 0x20000,
|
READ_RSSI = 0x40000,
|
||||||
WRITE_SUPERVISION_TIMEOUT = 0x40000,
|
WRITE_SUPERVISION_TIMEOUT = 0x80000,
|
||||||
|
|
||||||
} hci_authentication_flags_t;
|
} hci_authentication_flags_t;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user