diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2008-03-10 20:54:28 +0000 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2008-03-10 20:54:28 +0000 |
commit | 436b2217f66a04970b3e1b78445d0c86e0513731 (patch) | |
tree | b5a90df7351cf8e00d4be706627ac0eb8f339051 /hcid/adapter.c | |
parent | b0566c457e956e03ae5ff3fe4ae15a9176b0ae24 (diff) |
Storing device's profiles
Diffstat (limited to 'hcid/adapter.c')
-rw-r--r-- | hcid/adapter.c | 12 |
1 files changed, 12 insertions, 0 deletions
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); |