From e35dd0c0246236371269b79cc28b1a23f4999560 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 3 Feb 2009 12:15:07 -0800 Subject: Add support for HCI_Simple_Pairing_Complete event When we are the acceptors of a pairing request and we have used the Agent.DisplayPasskey we need to use the Simple Pairing Complete HCI event for calling Agent.Cancel. --- src/dbus-hci.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/dbus-hci.c') diff --git a/src/dbus-hci.c b/src/dbus-hci.c index 8059478d..7950ce79 100644 --- a/src/dbus-hci.c +++ b/src/dbus-hci.c @@ -445,6 +445,31 @@ void hcid_dbus_bonding_process_complete(bdaddr_t *local, bdaddr_t *peer, device_bonding_complete(device, status); } +void hcid_dbus_simple_pairing_complete(bdaddr_t *local, bdaddr_t *peer, + uint8_t status) +{ + struct btd_adapter *adapter; char peer_addr[18]; + struct btd_device *device; + + debug("hcid_dbus_simple_pairing_complete: status=%02x", status); + + adapter = manager_find_adapter(local); + if (!adapter) { + error("Unable to find matching adapter"); + return; + } + + ba2str(peer, peer_addr); + + device = adapter_find_device(adapter, peer_addr); + if (!device) { + error("Unable to get device object!"); + return; + } + + device_simple_pairing_complete(device, status); +} + void hcid_dbus_inquiry_start(bdaddr_t *local) { struct btd_adapter *adapter; -- cgit