summaryrefslogtreecommitdiffstats
path: root/hcid/dbus.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2006-03-29 12:06:42 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2006-03-29 12:06:42 +0000
commit5f1a975cd0b773a655c29ded8a20d062a49df6cf (patch)
tree054d6ff1c78a4795ddd73cf1e93e95cefa7ca42e /hcid/dbus.c
parent80d0f4993e8282bc3b11ee7a7ca6daa7d13928c1 (diff)
Track pairing state (so Bonding signals aren't sent in wrong situations)
Diffstat (limited to 'hcid/dbus.c')
-rw-r--r--hcid/dbus.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/hcid/dbus.c b/hcid/dbus.c
index 413f6853..6ed5b6a4 100644
--- a/hcid/dbus.c
+++ b/hcid/dbus.c
@@ -611,7 +611,7 @@ void hcid_dbus_request_pin(int dev, bdaddr_t *sba, struct hci_conn_info *ci)
handle_passkey_request(dev, path, sba, &ci->bdaddr);
}
-void hcid_dbus_bonding_created_complete(bdaddr_t *local, bdaddr_t *peer, const uint8_t status)
+void hcid_dbus_bonding_process_complete(bdaddr_t *local, bdaddr_t *peer, const uint8_t status)
{
struct hci_dbus_data *pdata;
DBusMessage *msg_reply = NULL;
@@ -633,6 +633,18 @@ void hcid_dbus_bonding_created_complete(bdaddr_t *local, bdaddr_t *peer, const u
snprintf(path, sizeof(path), "%s/hci%d", ADAPTER_PATH, id);
+ /* create the authentication reply */
+ if (!dbus_connection_get_object_path_data(connection, path, (void *) &pdata)) {
+ error("Getting %s path data failed!", path);
+ goto failed;
+ }
+
+ /* Don't send any signals if a pairing process isn't active */
+ if (!pdata->pairing_active)
+ return;
+
+ pdata->pairing_active = 0;
+
/*
* 0x00: authentication request successfully completed
* 0x01-0x0F: authentication request failed
@@ -657,12 +669,6 @@ void hcid_dbus_bonding_created_complete(bdaddr_t *local, bdaddr_t *peer, const u
dbus_connection_flush(connection);
- /* create the authentication reply */
- if (!dbus_connection_get_object_path_data(connection, path, (void *) &pdata)) {
- error("Getting %s path data failed!", path);
- goto failed;
- }
-
if (!pdata->bonding)
goto failed; /* skip: no bonding req pending */