From: "Frédéric Danis" <frederic.danis@linux.intel.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH 05/14] adapter: Probe profiles after device creation
Date: Wed, 12 Dec 2012 16:47:54 +0100 [thread overview]
Message-ID: <1355327283-1558-5-git-send-email-frederic.danis@linux.intel.com> (raw)
In-Reply-To: <1355327283-1558-1-git-send-email-frederic.danis@linux.intel.com>
---
src/adapter.c | 40 ++++------------------------------------
1 file changed, 4 insertions(+), 36 deletions(-)
diff --git a/src/adapter.c b/src/adapter.c
index 7ab2389..10aacbf 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -1631,38 +1631,6 @@ static const GDBusPropertyTable adapter_properties[] = {
{ }
};
-static void create_stored_device_from_profiles(char *key, char *value,
- void *user_data)
-{
- char address[18];
- uint8_t bdaddr_type;
- struct btd_adapter *adapter = user_data;
- GSList *list, *uuids = bt_string2list(value);
- struct btd_device *device;
-
- if (sscanf(key, "%17s#%hhu", address, &bdaddr_type) < 2)
- bdaddr_type = BDADDR_BREDR;
-
- if (g_slist_find_custom(adapter->devices,
- address, (GCompareFunc) device_address_cmp))
- return;
-
- device = device_create(adapter, address, bdaddr_type);
- if (!device)
- return;
-
- device_set_temporary(device, FALSE);
- adapter->devices = g_slist_append(adapter->devices, device);
-
- list = device_services_from_record(device, uuids);
- if (list)
- device_register_services(device, list, ATT_PSM);
-
- device_probe_profiles(device, uuids);
-
- g_slist_free_full(uuids, g_free);
-}
-
struct adapter_keys {
struct btd_adapter *adapter;
GSList *keys;
@@ -1846,10 +1814,6 @@ static void load_devices(struct btd_adapter *adapter)
ba2str(&adapter->bdaddr, srcaddr);
- create_name(filename, PATH_MAX, STORAGEDIR, srcaddr, "profiles");
- textfile_foreach(filename, create_stored_device_from_profiles,
- adapter);
-
create_name(filename, PATH_MAX, STORAGEDIR, srcaddr, "primaries");
textfile_foreach(filename, create_stored_device_from_primaries,
adapter);
@@ -1903,6 +1867,10 @@ static void load_devices(struct btd_adapter *adapter)
device_set_temporary(device, FALSE);
adapter->devices = g_slist_append(adapter->devices, device);
+ l = device_get_uuids(device);
+ if (l)
+ device_probe_profiles(device, l);
+
device_exist:
if (key_info || ltk_info) {
device_set_paired(device, TRUE);
--
1.7.9.5
next prev parent reply other threads:[~2012-12-12 15:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-12 15:47 [PATCH 01/14] device: Retrieve device technology from storage Frédéric Danis
2012-12-12 15:47 ` [PATCH 02/14] device: Add device_create_from_storage() function Frédéric Danis
2012-12-12 15:47 ` [PATCH 03/14] adapter: Convert device profiles list Frédéric Danis
2012-12-12 15:47 ` [PATCH 04/14] device: Load profiles from storage Frédéric Danis
2012-12-12 15:47 ` Frédéric Danis [this message]
2012-12-12 15:47 ` [PATCH 06/14] device: Delete storage device recursively Frédéric Danis
2012-12-12 15:47 ` [PATCH 07/14] adapter: Convert device sdp file Frédéric Danis
2012-12-12 15:47 ` [PATCH 08/14] device: Load services from storage Frédéric Danis
2012-12-12 15:47 ` [PATCH 09/14] device: Update services from SDP records Frédéric Danis
2012-12-12 15:47 ` [PATCH 10/14] adapter: Convert device primaries list Frédéric Danis
2012-12-12 15:48 ` [PATCH 11/14] adapter: Register services after device creation Frédéric Danis
2012-12-12 15:48 ` [PATCH 12/14] device: Add device_get_storage_path() Frédéric Danis
2012-12-12 15:48 ` [PATCH 13/14] device: Retrieve records from tmp_records only Frédéric Danis
2012-12-12 15:48 ` [PATCH 14/14] input: Use new storage architecture Frédéric Danis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1355327283-1558-5-git-send-email-frederic.danis@linux.intel.com \
--to=frederic.danis@linux.intel.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.