Send complete event in case of disconnection

This commit is contained in:
mila@ringwald.ch 2014-05-15 12:56:28 +00:00
parent b398e4aaf1
commit faab072e58
2 changed files with 1 additions and 3 deletions

View File

@ -770,9 +770,8 @@ void gatt_packet_handler(void * connection, uint8_t packet_type, uint16_t channe
gatt_client_t * peripheral = get_gatt_client_context_for_handle(handle);
if (!peripheral) break;
// TODO should we send some complete event if transaction pending???
peripheral->gatt_client_state = P_READY;
send_gatt_complete_event(peripheral, 0);
linked_list_remove(&gatt_client_connections, (linked_item_t *) peripheral);
break;
}

View File

@ -855,7 +855,6 @@ static void daemon_packet_handler(void * connection, uint8_t packet_type, uint16
uint16_t handle = READ_BT_16(packet, 3);
gatt_client_t *context = get_gatt_client_context_for_handle(handle);
if (!context) break;
// @TODO return some complete event if request is active
gatt_client_stop(context);
free(context);
break;