mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-15 23:42:52 +00:00
hci: discard ACL fragement on connection close, too
This commit is contained in:
parent
28a0332dbe
commit
c6a37cfdba
12
src/hci.c
12
src/hci.c
@ -1717,9 +1717,17 @@ static void event_handler(uint8_t *packet, int size){
|
|||||||
case HCI_EVENT_DISCONNECTION_COMPLETE:
|
case HCI_EVENT_DISCONNECTION_COMPLETE:
|
||||||
if (packet[2]) break; // status != 0
|
if (packet[2]) break; // status != 0
|
||||||
handle = little_endian_read_16(packet, 3);
|
handle = little_endian_read_16(packet, 3);
|
||||||
conn = hci_connection_for_handle(handle);
|
// drop outgoing ACL fragments if it is for closed connection
|
||||||
if (!conn) break; // no conn struct anymore
|
if (hci_stack->acl_fragmentation_total_size > 0) {
|
||||||
|
if (handle == READ_ACL_CONNECTION_HANDLE(hci_stack->hci_packet_buffer)){
|
||||||
|
log_info("hci: drop fragmented ACL data for closed connection");
|
||||||
|
hci_stack->acl_fragmentation_total_size = 0;
|
||||||
|
hci_stack->acl_fragmentation_pos = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
// re-enable advertisements for le connections if active
|
// re-enable advertisements for le connections if active
|
||||||
|
conn = hci_connection_for_handle(handle);
|
||||||
|
if (!conn) break;
|
||||||
if (hci_is_le_connection(conn) && hci_stack->le_advertisements_enabled){
|
if (hci_is_le_connection(conn) && hci_stack->le_advertisements_enabled){
|
||||||
hci_stack->le_advertisements_todo |= LE_ADVERTISEMENT_TASKS_ENABLE;
|
hci_stack->le_advertisements_todo |= LE_ADVERTISEMENT_TASKS_ENABLE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user