From 8f4dd6c139388844e52e2802e9061184f613fa9f Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 6 Aug 2019 17:59:22 +0200 Subject: [PATCH] l2cap: stop ertm timers in l2cap_free_channel_entry --- CHANGELOG.md | 1 + src/l2cap.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8030802dd..4ea3f5f04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - RFCOMM: accept incoming L2CAP connection in Basic mode if ERTM is enabled but not requested for this connection - POSIX, WICED, Windows, FreeRTOS: handle time_ms overrun after 49 days +- L2CAP ERTM: stop timers on disconnect ### Added - btstack_run_loop_base: portable implementation of timer and data source managment as base for platform specific implementations diff --git a/src/l2cap.c b/src/l2cap.c index 52ea0d9c8..fabd8fe01 100644 --- a/src/l2cap.c +++ b/src/l2cap.c @@ -1867,8 +1867,12 @@ static l2cap_channel_t * l2cap_create_channel_entry(btstack_packet_handler_t pac static void l2cap_free_channel_entry(l2cap_channel_t * channel){ log_info("free channel %p, local_cid 0x%04x", channel, channel->local_cid); - // assert rts/ertx timers are stopped + // assert all timers are stopped l2cap_stop_rtx(channel); +#ifdef ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE + l2cap_ertm_stop_retransmission_timer(channel); + l2cap_ertm_stop_monitor_timer(channel); +#endif // free memory btstack_memory_l2cap_channel_free(channel); }