From d452db97fd3b0f8254bbee44917ca0c3cfec2b12 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 17 Feb 2006 17:57:24 +0000 Subject: Fix small bug with the timeout handling --- hcid/dbus.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hcid/dbus.c b/hcid/dbus.c index e96f3adf..853c2589 100644 --- a/hcid/dbus.c +++ b/hcid/dbus.c @@ -67,6 +67,11 @@ struct pin_request { bdaddr_t bda; }; +/* + * Timeout functions Protypes + */ +static int discoverable_timeout_handler(void *data); + DBusConnection *get_dbus_connection(void) { return connection; @@ -315,6 +320,13 @@ gboolean hcid_dbus_register_device(uint16_t id) else pdata->mode = rp.enable; /* Keep the current scan status */ + /* + * Enable timeout to address dbus daemon restart, where + * register the device paths is required due connection lost. + */ + if (pdata->mode & SCAN_INQUIRY) + pdata->timeout_handler = &discoverable_timeout_handler; + message = dbus_message_new_signal(MANAGER_PATH, MANAGER_INTERFACE, BLUEZ_MGR_DEV_ADDED); if (message == NULL) { -- cgit