mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-25 09:35:42 +00:00
disconnect LE HCI Connections for active GATT Clients
This commit is contained in:
parent
c73ffc61ed
commit
4d766027c1
@ -562,6 +562,7 @@ gatt_client_t * get_gatt_client_context_for_handle(uint16_t handle){
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static void gatt_client_run(){
|
||||
if (!hci_can_send_packet_now_using_packet_buffer(HCI_COMMAND_DATA_PACKET)) return;
|
||||
// printf("handle_peripheral_list 4\n");
|
||||
@ -1249,3 +1250,15 @@ le_command_status_t gatt_client_write_long_characteristic_descriptor(gatt_client
|
||||
return BLE_PERIPHERAL_OK;
|
||||
}
|
||||
|
||||
// used by daemon
|
||||
void gatt_client_disconnect_connection(connection_t * connection){
|
||||
if (!connection) return;
|
||||
linked_item_t *it;
|
||||
for (it = (linked_item_t *) gatt_client_connections; it ; it = it->next){
|
||||
gatt_client_t * client = (gatt_client_t *) it;
|
||||
if (client->context == connection){
|
||||
gap_le_disconnect(client->handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -220,6 +220,9 @@ void gatt_client_register_handler(void (*le_callback)(le_event_t * event));
|
||||
void gatt_client_start(gatt_client_t *context, uint16_t handle);
|
||||
void gatt_client_stop(gatt_client_t *context);
|
||||
gatt_client_t * get_gatt_client_context_for_handle(uint16_t handle);
|
||||
void gatt_client_disconnect_connection(connection_t * connection);
|
||||
|
||||
// next command is used with daemon
|
||||
int gatt_client_is_ready(gatt_client_t *context);
|
||||
|
||||
// returns primary services
|
||||
|
Loading…
x
Reference in New Issue
Block a user