ble/gatt_client: add a function to remove a queued can send now request

This commit is contained in:
Dirk Helbig 2024-04-14 17:28:33 +02:00 committed by Matthias Ringwald
parent 50e8757d79
commit 48553f675e
2 changed files with 18 additions and 0 deletions

View File

@ -2852,6 +2852,16 @@ uint8_t gatt_client_request_to_send_gatt_query(btstack_context_callback_registra
}
}
uint8_t gatt_client_remove_gatt_query(btstack_context_callback_registration_t * callback_registration, hci_con_handle_t con_handle){
gatt_client_t * gatt_client;
uint8_t status = gatt_client_provide_context_for_handle(con_handle, &gatt_client);
if (status != ERROR_CODE_SUCCESS){
return status;
}
(void)btstack_linked_list_remove(&gatt_client->query_requests, (btstack_linked_item_t*) callback_registration);
return ERROR_CODE_SUCCESS;
}
uint8_t gatt_client_request_can_write_without_response_event(btstack_packet_handler_t callback, hci_con_handle_t con_handle){
gatt_client_t * gatt_client;
uint8_t status = gatt_client_provide_context_for_handle(con_handle, &gatt_client);

View File

@ -977,6 +977,14 @@ uint8_t gatt_client_cancel_write(btstack_packet_handler_t callback, hci_con_hand
*/
uint8_t gatt_client_request_to_send_gatt_query(btstack_context_callback_registration_t * callback_registration, hci_con_handle_t con_handle);
/**
* @brief Remove queued callback for regular gatt queries, to be used on disconnect for example
* @param callback_registration
* @param con_handle
* @return ERROR_CODE_SUCCESS if ok
*/
uint8_t gatt_client_remove_gatt_query(btstack_context_callback_registration_t * callback_registration, hci_con_handle_t con_handle);
/**
* @brief Request callback when writing characteristic value without response is possible
* @note callback might happen during call to this function