summaryrefslogtreecommitdiffstats
path: root/src/device.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-02-03 12:15:07 -0800
committerJohan Hedberg <johan.hedberg@nokia.com>2009-02-03 12:19:00 -0800
commite35dd0c0246236371269b79cc28b1a23f4999560 (patch)
tree59d611de1106fc3db522ac998e73234035a2c855 /src/device.c
parentf7d1ee361e410e096929bd3918178af356c50bbd (diff)
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.
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c15
1 files changed, 15 insertions, 0 deletions
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;