mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 04:43:33 +00:00
component/bt: free timer resources after using them
Bluedroid use a set of timer function pairs such as btu_start_timer/btu_stop_timer, btu_sys_start_timer/btu_sys_stop_timer for use, in a lack of timer release functions. Thus the timers may be exhausted after some event sequence such as repetition of connection/reconnection with different devices. The maximum timer number used in bluedroid is given by ALARM_CBS_NUM which is 30 for now. This bugfix borrowed some update from bluedroid in Andoroid 7.0, which add timer release functions which promote the recycle of timer resources.
This commit is contained in:
@@ -265,6 +265,7 @@ void port_release_port (tPORT *p_port)
|
||||
memcpy (p_port->bd_addr, BT_BD_ANY, BD_ADDR_LEN);
|
||||
} else {
|
||||
RFCOMM_TRACE_DEBUG ("port_release_port:Clean-up handle:%d", p_port->inx);
|
||||
rfc_port_timer_free (p_port);
|
||||
memset (p_port, 0, sizeof (tPORT));
|
||||
}
|
||||
}
|
||||
@@ -568,4 +569,4 @@ void port_flow_control_peer(tPORT *p_port, BOOLEAN enable, UINT16 count)
|
||||
}
|
||||
|
||||
|
||||
#endif ///(defined RFCOMM_INCLUDED && RFCOMM_INCLUDED == TRUE)
|
||||
#endif ///(defined RFCOMM_INCLUDED && RFCOMM_INCLUDED == TRUE)
|
||||
|
Reference in New Issue
Block a user