mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-25 09:02:30 +00:00
att_server: check if connection handle is valid before queue can send now request (fix)
This commit is contained in:
parent
86da9d7414
commit
49aa330baa
@ -857,14 +857,7 @@ void att_server_request_can_send_now_event(hci_con_handle_t con_handle){
|
|||||||
|
|
||||||
void att_server_register_can_send_now_callback(btstack_context_callback_registration_t * callback_registration, hci_con_handle_t con_handle){
|
void att_server_register_can_send_now_callback(btstack_context_callback_registration_t * callback_registration, hci_con_handle_t con_handle){
|
||||||
// check if valid con handle
|
// check if valid con handle
|
||||||
switch (gap_get_connection_type(con_handle)){
|
if (gap_get_connection_type(con_handle) != GAP_CONNECTION_LE) return;
|
||||||
case BD_ADDR_TYPE_LE_PUBLIC:
|
|
||||||
case BD_ADDR_TYPE_LE_RANDOM:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
// con handle not valid for att send
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
callback_registration->context = (void*)(uintptr_t) con_handle;
|
callback_registration->context = (void*)(uintptr_t) con_handle;
|
||||||
btstack_linked_list_add_tail(&can_send_now_clients, (btstack_linked_item_t*) callback_registration);
|
btstack_linked_list_add_tail(&can_send_now_clients, (btstack_linked_item_t*) callback_registration);
|
||||||
att_dispatch_server_request_can_send_now_event(con_handle);
|
att_dispatch_server_request_can_send_now_event(con_handle);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user