Bluetooth: Add support for connect failed management event

This patch add a new connect failed management event to track failures
in connecting to remote devices. It is particularly useful for security
mode 3 scenarios when we don't have a connected state while pairing but
still need to detect when the connect attempt failed.

Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
This commit is contained in:
Johan Hedberg 2011-01-22 06:09:08 +02:00 committed by Gustavo F. Padovan
parent 8962ee74be
commit 17d5c04cb5
4 changed files with 23 additions and 1 deletions

View file

@ -1227,3 +1227,14 @@ int mgmt_disconnect_failed(u16 index)
return err;
}
int mgmt_connect_failed(u16 index, bdaddr_t *bdaddr, u8 status)
{
struct mgmt_ev_connect_failed ev;
put_unaligned_le16(index, &ev.index);
bacpy(&ev.bdaddr, bdaddr);
ev.status = status;
return mgmt_event(MGMT_EV_CONNECT_FAILED, &ev, sizeof(ev), NULL);
}