gatt_client.c (abdc9fb59b2eadafc2464f74b9b2ad9a5ac43b00) | gatt_client.c (cce308d62636989d6f4dd792bf27735334b22899) |
---|---|
1/* 2 * Copyright (C) 2014 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 1078 unchanged lines hidden (view full) --- 1087 hci_con_handle_t con_handle; 1088 gatt_client_t * peripheral; 1089 switch (hci_event_packet_get_type(packet)) { 1090 case HCI_EVENT_DISCONNECTION_COMPLETE: 1091 log_info("GATT Client: HCI_EVENT_DISCONNECTION_COMPLETE"); 1092 con_handle = little_endian_read_16(packet,3); 1093 peripheral = get_gatt_client_context_for_handle(con_handle); 1094 if (!peripheral) break; | 1/* 2 * Copyright (C) 2014 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 1078 unchanged lines hidden (view full) --- 1087 hci_con_handle_t con_handle; 1088 gatt_client_t * peripheral; 1089 switch (hci_event_packet_get_type(packet)) { 1090 case HCI_EVENT_DISCONNECTION_COMPLETE: 1091 log_info("GATT Client: HCI_EVENT_DISCONNECTION_COMPLETE"); 1092 con_handle = little_endian_read_16(packet,3); 1093 peripheral = get_gatt_client_context_for_handle(con_handle); 1094 if (!peripheral) break; |
1095 gatt_client_report_error_if_pending(peripheral, ATT_ERROR_HCI_DISCONNECT_RECEIVED); | |
1096 | 1095 |
1096 gatt_client_report_error_if_pending(peripheral, ATT_ERROR_HCI_DISCONNECT_RECEIVED); 1097 gatt_client_timeout_stop(peripheral); |
|
1097 btstack_linked_list_remove(&gatt_client_connections, (btstack_linked_item_t *) peripheral); 1098 btstack_memory_gatt_client_free(peripheral); 1099 break; 1100 1101#ifdef ENABLE_GATT_CLIENT_PAIRING 1102 // Pairing complete (with/without bonding=storing of pairing information) 1103 case SM_EVENT_PAIRING_COMPLETE: 1104 con_handle = sm_event_pairing_complete_get_handle(packet); --- 1026 unchanged lines hidden --- | 1098 btstack_linked_list_remove(&gatt_client_connections, (btstack_linked_item_t *) peripheral); 1099 btstack_memory_gatt_client_free(peripheral); 1100 break; 1101 1102#ifdef ENABLE_GATT_CLIENT_PAIRING 1103 // Pairing complete (with/without bonding=storing of pairing information) 1104 case SM_EVENT_PAIRING_COMPLETE: 1105 con_handle = sm_event_pairing_complete_get_handle(packet); --- 1026 unchanged lines hidden --- |