gatt_client: add gatt_client_stop_listening_for_characteristic_value_updates

This commit is contained in:
Matthias Ringwald 2017-07-14 12:32:06 +02:00
parent 4a76e901eb
commit 1f734b5f46
2 changed files with 10 additions and 0 deletions

View File

@ -470,6 +470,10 @@ void gatt_client_listen_for_characteristic_value_updates(gatt_client_notificatio
btstack_linked_list_add(&gatt_client_value_listeners, (btstack_linked_item_t*) notification);
}
void gatt_client_stop_listening_for_characteristic_value_updates(gatt_client_notification_t * notification){
btstack_linked_list_remove(&gatt_client_value_listeners, (btstack_linked_item_t*) notification);
}
static void emit_event_to_registered_listeners(hci_con_handle_t con_handle, uint16_t attribute_handle, uint8_t * packet, uint16_t size){
btstack_linked_list_iterator_t it;
btstack_linked_list_iterator_init(&it, &gatt_client_value_listeners);

View File

@ -341,6 +341,12 @@ uint8_t gatt_client_write_client_characteristic_configuration(btstack_packet_han
*/
void gatt_client_listen_for_characteristic_value_updates(gatt_client_notification_t * notification, btstack_packet_handler_t packet_handler, hci_con_handle_t con_handle, gatt_client_characteristic_t * characteristic);
/**
* @brief Stop listening to characteristic value updates registered with gatt_client_listen_for_characteristic_value_updates
* @param notification struct used in gatt_client_listen_for_characteristic_value_updates
*/
void gatt_client_stop_listening_for_characteristic_value_updates(gatt_client_notification_t * notification);
/**
* @brief -> gatt complete event
*/