Bluetooth: Fix calling timeout fiber for BR/EDR connection

This timeout is used only on LE link to cancel ongoing LE connection.
For BR/EDR link controller will handle page timeout.

> HCI Event: PIN Code Request (0x16) plen 6
        Address: XX:XX:XX:XX:XX:XX (Sony Mobile Communications AB)
< HCI Command: LE Create Connection Cancel (0x08|0x000e) plen 0
> HCI Event: Command Complete (0x0e) plen 4
      LE Create Connection Cancel (0x08|0x000e) ncmd 1
        Status: Command Disallowed (0x0c)

Change-Id: I6a03da7f935f0c560d57f18abc16069d79e2be69
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This commit is contained in:
Szymon Janc 2016-01-11 17:24:43 +01:00 committed by Anas Nashif
commit 1a54c49ceb

View file

@ -663,6 +663,14 @@ void bt_conn_set_state(struct bt_conn *conn, bt_conn_state_t state)
case BT_CONN_CONNECT_SCAN:
break;
case BT_CONN_CONNECT:
/*
* Timer is needed only for LE. For other link types controller
* will handle connection timeout.
*/
if (conn->type != BT_CONN_TYPE_LE) {
break;
}
/* Add LE Create Connection timeout */
conn->timeout = fiber_delayed_start(conn->stack,
sizeof(conn->stack),