diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2007-02-25 20:53:01 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2007-02-25 20:53:01 +0000 |
commit | 53031087fce5c0c0a80f7a9c51e36e53333935a4 (patch) | |
tree | fbf914e2e2c45a5fe0db93a52c48588e02aad17f /audio | |
parent | 81bfe1e51bc7718ac0568572b7cec93b79fa7350 (diff) |
Send CancelAuthorizationRequest when timing out waiting for a reply from hcid
Diffstat (limited to 'audio')
-rw-r--r-- | audio/headset.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/audio/headset.c b/audio/headset.c index 4b7228ce..81d6ac7c 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -388,6 +388,28 @@ failed: return FALSE; } +static void send_cancel_auth(struct headset *hs) +{ + DBusMessage *cancel; + char addr[18], *address = addr; + const char *uuid = ""; + + cancel = dbus_message_new_method_call("org.bluez", "/org/bluez", + "org.bluez.Database", + "CancelAuthorizationRequest"); + if (!cancel) { + error("Unable to allocate new method call"); + return; + } + + ba2str(&hs->bda, addr); + + dbus_message_append_args(cancel, DBUS_TYPE_STRING, &address, + DBUS_TYPE_STRING, &uuid, DBUS_TYPE_INVALID); + + send_message_and_unref(connection, cancel); +} + static void auth_callback(DBusPendingCall *call, void *data) { struct headset *hs = data; @@ -399,7 +421,7 @@ static void auth_callback(DBusPendingCall *call, void *data) error("Access denied: %s", err.message); if (dbus_error_has_name(&err, DBUS_ERROR_NO_REPLY)) { debug("Canceling authorization request"); - //send_cancel(); + send_cancel_auth(hs); } dbus_error_free(&err); g_io_channel_close(hs->rfcomm); |