Bluetooth: Add connected/disconnected management events
This patch adds connected and disconnected managment events to track the connection status to remote devices. The events map directly to successful connection complete and disconnection complete HCI events for ACL links. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
This commit is contained in:
committed by
Gustavo F. Padovan
parent
55ed8ca10f
commit
f7520543ab
@ -1090,3 +1090,23 @@ int mgmt_new_key(u16 index, struct link_key *key, u8 old_key_type)
|
||||
|
||||
return mgmt_event(MGMT_EV_NEW_KEY, &ev, sizeof(ev), NULL);
|
||||
}
|
||||
|
||||
int mgmt_connected(u16 index, bdaddr_t *bdaddr)
|
||||
{
|
||||
struct mgmt_ev_connected ev;
|
||||
|
||||
put_unaligned_le16(index, &ev.index);
|
||||
bacpy(&ev.bdaddr, bdaddr);
|
||||
|
||||
return mgmt_event(MGMT_EV_CONNECTED, &ev, sizeof(ev), NULL);
|
||||
}
|
||||
|
||||
int mgmt_disconnected(u16 index, bdaddr_t *bdaddr)
|
||||
{
|
||||
struct mgmt_ev_disconnected ev;
|
||||
|
||||
put_unaligned_le16(index, &ev.index);
|
||||
bacpy(&ev.bdaddr, bdaddr);
|
||||
|
||||
return mgmt_event(MGMT_EV_DISCONNECTED, &ev, sizeof(ev), NULL);
|
||||
}
|
||||
|
Reference in New Issue
Block a user