From 436b2217f66a04970b3e1b78445d0c86e0513731 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Mon, 10 Mar 2008 20:54:28 +0000 Subject: Storing device's profiles --- hcid/adapter.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'hcid/adapter.c') diff --git a/hcid/adapter.c b/hcid/adapter.c index 83a575b6..2cd526e2 100644 --- a/hcid/adapter.c +++ b/hcid/adapter.c @@ -3235,6 +3235,7 @@ static void discover_services_cb(gpointer user_data, sdp_list_t *recs, int err) DBusMessage *reply; GSList *uuids; const char *path; + bdaddr_t src, dst; if (err < 0) { error_connection_attempt_failed(adapter->create->conn, @@ -3267,6 +3268,7 @@ static void discover_services_cb(gpointer user_data, sdp_list_t *recs, int err) if (!path) goto failed; + /* Reply create device request */ reply = dbus_message_new_method_return(adapter->create->msg); if (!reply) goto failed; @@ -3277,6 +3279,16 @@ static void discover_services_cb(gpointer user_data, sdp_list_t *recs, int err) adapter->devices = g_slist_append(adapter->devices, g_strdup(path)); + /* Store the device's profiles in the filesystem */ + str2ba(adapter->address, &src); + str2ba(adapter->create->address, &dst); + if (uuids) { + char *str = bt_list2string(uuids); + write_device_profiles(&src, &dst, str); + g_free(str); + } else + write_device_profiles(&src, &dst, ""); + failed: dbus_connection_unref(adapter->create->conn); dbus_message_unref(adapter->create->msg); -- cgit