mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-07 16:20:19 +00:00
gap: write supervision timeout after connection complete [a2349]
This commit is contained in:
parent
0c3eb48d98
commit
6909f06401
13
src/hci.c
13
src/hci.c
@ -2155,8 +2155,15 @@ static void event_handler(uint8_t *packet, int size){
|
|||||||
if (!packet[2]){
|
if (!packet[2]){
|
||||||
conn->state = OPEN;
|
conn->state = OPEN;
|
||||||
conn->con_handle = little_endian_read_16(packet, 3);
|
conn->con_handle = little_endian_read_16(packet, 3);
|
||||||
|
|
||||||
|
// queue get remote feature
|
||||||
conn->bonding_flags |= BONDING_REQUEST_REMOTE_FEATURES;
|
conn->bonding_flags |= BONDING_REQUEST_REMOTE_FEATURES;
|
||||||
|
|
||||||
|
// queue set supervision timeout
|
||||||
|
if (hci_stack->link_supervision_timeout != 0){
|
||||||
|
connectionSetAuthenticationFlags(conn, WRITE_SUPERVISION_TIMEOUT);
|
||||||
|
}
|
||||||
|
|
||||||
// restart timer
|
// restart timer
|
||||||
btstack_run_loop_set_timer(&conn->timeout, HCI_CONNECTION_TIMEOUT_MS);
|
btstack_run_loop_set_timer(&conn->timeout, HCI_CONNECTION_TIMEOUT_MS);
|
||||||
btstack_run_loop_add_timer(&conn->timeout);
|
btstack_run_loop_add_timer(&conn->timeout);
|
||||||
@ -3601,6 +3608,12 @@ static void hci_run(void){
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (connection->authentication_flags & WRITE_SUPERVISION_TIMEOUT){
|
||||||
|
connectionClearAuthenticationFlags(connection, WRITE_SUPERVISION_TIMEOUT);
|
||||||
|
hci_send_cmd(&hci_write_link_supervision_timeout, connection->con_handle, hci_stack->link_supervision_timeout);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_CLASSIC
|
#ifdef ENABLE_CLASSIC
|
||||||
if (connection->authentication_flags & HANDLE_LINK_KEY_REQUEST){
|
if (connection->authentication_flags & HANDLE_LINK_KEY_REQUEST){
|
||||||
log_info("responding to link key request");
|
log_info("responding to link key request");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user