summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-02-17 17:57:24 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-02-17 17:57:24 +0000
commitd452db97fd3b0f8254bbee44917ca0c3cfec2b12 (patch)
tree7b7f4a510e150b9e25cc6a12f8258aaef5eaed87
parentea6e51d583bde53514e7589267ba55f55b8a23e6 (diff)
Fix small bug with the timeout handling
-rw-r--r--hcid/dbus.c12
1 files changed, 12 insertions, 0 deletions
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) {