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/device.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/device.c') diff --git a/src/device.c b/src/device.c index 926d9591..df68639d 100644 --- a/src/device.c +++ b/src/device.c @@ -1816,9 +1816,24 @@ DBusMessage *device_create_bonding(struct btd_device *device, return NULL; } +void device_simple_pairing_complete(struct btd_device *device, uint8_t status) +{ + struct authentication_req *auth = device->authr; + + if (auth && auth->type == AUTH_TYPE_NOTIFY && auth->agent) + agent_cancel(auth->agent); + + g_free(auth); + device->authr = NULL; +} + void device_bonding_complete(struct btd_device *device, uint8_t status) { struct bonding_req *bonding = device->bonding; + struct authentication_req *auth = device->authr; + + if (auth && auth->type == AUTH_TYPE_NOTIFY && auth->agent) + agent_cancel(auth->agent); if (status) goto failed; -- cgit