summaryrefslogtreecommitdiffstats
path: root/src/device.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-09-25 22:34:16 -0700
committerJohan Hedberg <johan.hedberg@nokia.com>2008-09-25 22:34:16 -0700
commit68b27e68b50b1e68d663142d2b0432c435329ea6 (patch)
treef0bbacbff8d42cc5385be276043fc6826e1ff6d2 /src/device.c
parent35c7f1a0155e675c37c4e258c50ed4e49b3ae4f6 (diff)
Move more pairing and discovery initiation logic into device.c
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/device.c b/src/device.c
index 82a90e05..00589006 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1271,14 +1271,31 @@ static gboolean start_discovery(gpointer user_data)
return FALSE;
}
-void device_schedule_service_discovery(struct btd_device *device)
+void device_set_paired(DBusConnection *conn, struct btd_device *device,
+ struct bonding_request_info *bonding)
{
+ dbus_bool_t paired = TRUE;
+
+ device_set_temporary(device, FALSE);
+
+ dbus_connection_emit_property_changed(conn, device->path,
+ DEVICE_INTERFACE, "Paired",
+ DBUS_TYPE_BOOLEAN, &paired);
+
if (device->discov_timer)
return;
- device->discov_timer = g_timeout_add(DISCOVERY_TIMER,
- start_discovery,
- device);
+ /* If we were initiators start service discovery immediately.
+ * However if the other end was the initator wait a few seconds
+ * before SDP. This is due to potential IOP issues if the other
+ * end starts doing SDP at the same time as us */
+ if (bonding)
+ device_browse(device, bonding->conn,
+ bonding->msg, NULL);
+ else
+ device->discov_timer = g_timeout_add(DISCOVERY_TIMER,
+ start_discovery,
+ device);
}
int btd_register_device_driver(struct btd_device_driver *driver)