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:
wangmengyang
2018-01-27 19:03:06 +08:00
parent daa8cfa800
commit 90c9ffa975
23 changed files with 231 additions and 56 deletions

View File

@@ -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)