Bluetooth: host: Don't send slave conn param request if not needed
If master or application decided to switch connection parameters to ones that meet pending parameters don't bother sending request after 5 seconds timeout. Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
This commit is contained in:
parent
37fcec9833
commit
bf71fa1aeb
1 changed files with 12 additions and 0 deletions
|
@ -153,6 +153,17 @@ void notify_le_param_updated(struct bt_conn *conn)
|
|||
{
|
||||
struct bt_conn_cb *cb;
|
||||
|
||||
/* If new connection parameters meet requirement of pending
|
||||
* parameters don't send slave conn param request anymore on timeout
|
||||
*/
|
||||
if (atomic_test_bit(conn->flags, BT_CONN_SLAVE_PARAM_SET) &&
|
||||
conn->le.interval >= conn->le.interval_min &&
|
||||
conn->le.interval <= conn->le.interval_max &&
|
||||
conn->le.latency == conn->le.pending_latency &&
|
||||
conn->le.timeout == conn->le.pending_timeout) {
|
||||
atomic_clear_bit(conn->flags, BT_CONN_SLAVE_PARAM_SET);
|
||||
}
|
||||
|
||||
for (cb = callback_list; cb; cb = cb->_next) {
|
||||
if (cb->le_param_updated) {
|
||||
cb->le_param_updated(conn, conn->le.interval,
|
||||
|
@ -1811,6 +1822,7 @@ int bt_conn_le_param_update(struct bt_conn *conn,
|
|||
conn->le.interval <= param->interval_max &&
|
||||
conn->le.latency == param->latency &&
|
||||
conn->le.timeout == param->timeout) {
|
||||
atomic_clear_bit(conn->flags, BT_CONN_SLAVE_PARAM_SET);
|
||||
return -EALREADY;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue