mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-16 08:42:28 +00:00
hci: assert in gap_request_security_level switch on LE connection
This commit is contained in:
parent
5cf1669fe0
commit
defbf20033
21
src/hci.c
21
src/hci.c
@ -5030,6 +5030,9 @@ void gap_request_security_level(hci_con_handle_t con_handle, gap_security_level_
|
|||||||
hci_emit_security_level(con_handle, LEVEL_0);
|
hci_emit_security_level(con_handle, LEVEL_0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
btstack_assert(hci_is_le_connection(connection) == false);
|
||||||
|
|
||||||
gap_security_level_t current_level = gap_security_level(con_handle);
|
gap_security_level_t current_level = gap_security_level(con_handle);
|
||||||
log_info("gap_request_security_level requested level %u, planned level %u, current level %u",
|
log_info("gap_request_security_level requested level %u, planned level %u, current level %u",
|
||||||
requested_level, connection->requested_security_level, current_level);
|
requested_level, connection->requested_security_level, current_level);
|
||||||
@ -5055,20 +5058,10 @@ void gap_request_security_level(hci_con_handle_t con_handle, gap_security_level_
|
|||||||
// store request
|
// store request
|
||||||
connection->requested_security_level = requested_level;
|
connection->requested_security_level = requested_level;
|
||||||
|
|
||||||
if (hci_is_le_connection(connection)) {
|
// start to authenticate connection if authentication not already active
|
||||||
|
if ((connection->bonding_flags & BONDING_SENT_AUTHENTICATE_REQUEST) != 0) return;
|
||||||
// LE Connection - not implemented yet
|
connection->bonding_flags |= BONDING_SEND_AUTHENTICATE_REQUEST;
|
||||||
btstack_assert(false);
|
hci_run();
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// Classic Connection
|
|
||||||
|
|
||||||
// start to authenticate connection if authentication not already active
|
|
||||||
if ((connection->bonding_flags & BONDING_SENT_AUTHENTICATE_REQUEST) != 0) return;
|
|
||||||
connection->bonding_flags |= BONDING_SEND_AUTHENTICATE_REQUEST;
|
|
||||||
hci_run();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user