diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-04-22 12:20:24 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-04-22 12:20:24 +0000 |
commit | 9165d0442c6ff785d93ee9d2bb8dd8fbbe13fd2e (patch) | |
tree | 58a6feafdec79fa516f7fa029edfed66ad431874 | |
parent | 05498649453b5059c3fc317394ad21b42a62a669 (diff) |
Don't use hci_disconnect for disconnection since it'll "eat up" the disconnection complete event and the mainloop will never see it
-rw-r--r-- | hcid/security.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/hcid/security.c b/hcid/security.c index 62a79509..c9e7dda7 100644 --- a/hcid/security.c +++ b/hcid/security.c @@ -318,9 +318,16 @@ static void link_key_notify(int dev, bdaddr_t *sba, void *ptr) hcid_dbus_bonding_process_complete(sba, dba, HCI_MEMORY_FULL); - if (get_handle(dev, sba, dba, &handle) == 0) - hci_disconnect(dev, htobs(handle), - HCI_OE_LOW_RESOURCES, 500); + if (get_handle(dev, sba, dba, &handle) == 0) { + disconnect_cp cp; + + memset(&cp, 0, sizeof(cp)); + cp.handle = htobs(handle); + cp.reason = HCI_OE_LOW_RESOURCES; + + hci_send_cmd(dev, OGF_LINK_CTL, OCF_DISCONNECT, + DISCONNECT_CP_SIZE, &cp); + } } else hcid_dbus_bonding_process_complete(sba, dba, 0); |