diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2011-01-21 23:09:08 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-02-07 22:40:07 -0500 |
commit | 17d5c04cb597418a177c3ca18dfde679636dd51c (patch) | |
tree | 8f852ff43fe8a4da609a47a9f6e331d289a64a8c /net/bluetooth/mgmt.c | |
parent | 8962ee74be48df16027100f657b2b12e8ef3d34d (diff) |
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>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 48f266a64caf..9fb989f4216e 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -1227,3 +1227,14 @@ int mgmt_disconnect_failed(u16 index) | |||
1227 | 1227 | ||
1228 | return err; | 1228 | return err; |
1229 | } | 1229 | } |
1230 | |||
1231 | int mgmt_connect_failed(u16 index, bdaddr_t *bdaddr, u8 status) | ||
1232 | { | ||
1233 | struct mgmt_ev_connect_failed ev; | ||
1234 | |||
1235 | put_unaligned_le16(index, &ev.index); | ||
1236 | bacpy(&ev.bdaddr, bdaddr); | ||
1237 | ev.status = status; | ||
1238 | |||
1239 | return mgmt_event(MGMT_EV_CONNECT_FAILED, &ev, sizeof(ev), NULL); | ||
1240 | } | ||