drivers/nble: Cancel connect req when receiving disconnect cmd
Cancel ongoing connect request when we receive disconnect command. Change-Id: I12f1c1326c4b13672879b8f2dbe457cae395b486 Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
parent
dc9ff5872b
commit
1138996744
1 changed files with 11 additions and 1 deletions
|
@ -136,7 +136,7 @@ int bt_conn_disconnect(struct bt_conn *conn, uint8_t reason)
|
|||
|
||||
switch (conn->state) {
|
||||
case BT_CONN_CONNECT:
|
||||
/* TODO: Cancel connecting */
|
||||
nble_gap_cancel_connect_req(conn);
|
||||
return 0;
|
||||
case BT_CONN_CONNECTED:
|
||||
break;
|
||||
|
@ -168,6 +168,16 @@ void on_nble_gap_disconnect_rsp(const struct nble_response *rsp)
|
|||
BT_DBG("conn %p", rsp->user_data);
|
||||
}
|
||||
|
||||
void on_nble_gap_cancel_connect_rsp(const struct nble_response *rsp)
|
||||
{
|
||||
if (rsp->status) {
|
||||
BT_ERR("Cancel connect failed, status %d", rsp->status);
|
||||
return;
|
||||
}
|
||||
|
||||
BT_DBG("conn %p", rsp->user_data);
|
||||
}
|
||||
|
||||
static inline bool bt_le_conn_params_valid(uint16_t min, uint16_t max,
|
||||
uint16_t latency, uint16_t timeout)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue