mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-18 14:42:33 +00:00
l2cap: stop rtx/ertx timer in l2cap_free_channel_entry
This commit is contained in:
parent
c45d6b2caa
commit
b5bab9c804
@ -1467,7 +1467,6 @@ static void l2cap_run(void){
|
|||||||
channel->state = L2CAP_STATE_INVALID;
|
channel->state = L2CAP_STATE_INVALID;
|
||||||
l2cap_send_signaling_packet(channel->con_handle, CONNECTION_RESPONSE, channel->remote_sig_id, channel->local_cid, channel->remote_cid, channel->reason, 0);
|
l2cap_send_signaling_packet(channel->con_handle, CONNECTION_RESPONSE, channel->remote_sig_id, channel->local_cid, channel->remote_cid, channel->reason, 0);
|
||||||
// discard channel - l2cap_finialize_channel_close without sending l2cap close event
|
// discard channel - l2cap_finialize_channel_close without sending l2cap close event
|
||||||
l2cap_stop_rtx(channel);
|
|
||||||
btstack_linked_list_iterator_remove(&it);
|
btstack_linked_list_iterator_remove(&it);
|
||||||
l2cap_free_channel_entry(channel);
|
l2cap_free_channel_entry(channel);
|
||||||
break;
|
break;
|
||||||
@ -1689,7 +1688,6 @@ static void l2cap_run(void){
|
|||||||
channel->state = L2CAP_STATE_INVALID;
|
channel->state = L2CAP_STATE_INVALID;
|
||||||
l2cap_send_le_signaling_packet(channel->con_handle, LE_CREDIT_BASED_CONNECTION_RESPONSE, channel->remote_sig_id, 0, 0, 0, 0, channel->reason);
|
l2cap_send_le_signaling_packet(channel->con_handle, LE_CREDIT_BASED_CONNECTION_RESPONSE, channel->remote_sig_id, 0, 0, 0, 0, channel->reason);
|
||||||
// discard channel - l2cap_finialize_channel_close without sending l2cap close event
|
// discard channel - l2cap_finialize_channel_close without sending l2cap close event
|
||||||
l2cap_stop_rtx(channel);
|
|
||||||
btstack_linked_list_iterator_remove(&it);
|
btstack_linked_list_iterator_remove(&it);
|
||||||
l2cap_free_channel_entry(channel);
|
l2cap_free_channel_entry(channel);
|
||||||
break;
|
break;
|
||||||
@ -1869,6 +1867,9 @@ static l2cap_channel_t * l2cap_create_channel_entry(btstack_packet_handler_t pac
|
|||||||
|
|
||||||
static void l2cap_free_channel_entry(l2cap_channel_t * channel){
|
static void l2cap_free_channel_entry(l2cap_channel_t * channel){
|
||||||
log_info("free channel %p, local_cid 0x%04x", channel, channel->local_cid);
|
log_info("free channel %p, local_cid 0x%04x", channel, channel->local_cid);
|
||||||
|
// assert rts/ertx timers are stopped
|
||||||
|
l2cap_stop_rtx(channel);
|
||||||
|
// free memory
|
||||||
btstack_memory_l2cap_channel_free(channel);
|
btstack_memory_l2cap_channel_free(channel);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1965,7 +1966,6 @@ static void l2cap_handle_connection_failed_for_addr(bd_addr_t address, uint8_t s
|
|||||||
// failure, forward error code
|
// failure, forward error code
|
||||||
l2cap_handle_channel_open_failed(channel, status);
|
l2cap_handle_channel_open_failed(channel, status);
|
||||||
// discard channel
|
// discard channel
|
||||||
l2cap_stop_rtx(channel);
|
|
||||||
btstack_linked_list_remove(&l2cap_channels, (btstack_linked_item_t *) channel);
|
btstack_linked_list_remove(&l2cap_channels, (btstack_linked_item_t *) channel);
|
||||||
l2cap_free_channel_entry(channel);
|
l2cap_free_channel_entry(channel);
|
||||||
break;
|
break;
|
||||||
@ -2176,7 +2176,6 @@ static void l2cap_hci_event_handler(uint8_t packet_type, uint16_t cid, uint8_t *
|
|||||||
switch(channel->channel_type){
|
switch(channel->channel_type){
|
||||||
#ifdef ENABLE_CLASSIC
|
#ifdef ENABLE_CLASSIC
|
||||||
case L2CAP_CHANNEL_TYPE_CLASSIC:
|
case L2CAP_CHANNEL_TYPE_CLASSIC:
|
||||||
l2cap_stop_rtx(channel);
|
|
||||||
l2cap_handle_hci_disconnect_event(channel);
|
l2cap_handle_hci_disconnect_event(channel);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
@ -3487,7 +3486,6 @@ void l2cap_finialize_channel_close(l2cap_channel_t * channel){
|
|||||||
channel->state = L2CAP_STATE_CLOSED;
|
channel->state = L2CAP_STATE_CLOSED;
|
||||||
l2cap_handle_channel_closed(channel);
|
l2cap_handle_channel_closed(channel);
|
||||||
// discard channel
|
// discard channel
|
||||||
l2cap_stop_rtx(channel);
|
|
||||||
btstack_linked_list_remove(&l2cap_channels, (btstack_linked_item_t *) channel);
|
btstack_linked_list_remove(&l2cap_channels, (btstack_linked_item_t *) channel);
|
||||||
l2cap_free_channel_entry(channel);
|
l2cap_free_channel_entry(channel);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user