From: Szymon Janc <szymon.janc@tieto.com>
To: <linux-bluetooth@vger.kernel.org>
Cc: <kanak.gupta@stericsson.com>, Szymon Janc <szymon.janc@tieto.com>
Subject: [PATCH V2 2/7] Set DeviceID when registering adapter not when sdp server is starting
Date: Tue, 20 Mar 2012 17:27:22 +0100 [thread overview]
Message-ID: <1332260847-20079-2-git-send-email-szymon.janc@tieto.com> (raw)
In-Reply-To: <1332260847-20079-1-git-send-email-szymon.janc@tieto.com>
Adapter ops are registered after sdp server is started. Thus no
adapters were registered yet when setting DID on sdp startup and DID
was never set.
---
src/manager.c | 15 ++++-----------
src/manager.h | 1 -
src/sdpd-service.c | 3 ---
3 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/src/manager.c b/src/manager.c
index 8c49457..08388df 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -413,6 +413,10 @@ struct btd_adapter *btd_manager_register_adapter(int id, gboolean up)
if (default_adapter_id < 0)
manager_set_default_adapter(id);
+ if (main_opts.did)
+ btd_adapter_set_did(adapter, main_opts.did_vendor,
+ main_opts.did_product, main_opts.did_version);
+
DBG("Adapter %s registered", path);
return btd_adapter_ref(adapter);
@@ -435,14 +439,3 @@ int btd_manager_unregister_adapter(int id)
return 0;
}
-
-void btd_manager_set_did(uint16_t vendor, uint16_t product, uint16_t version)
-{
- GSList *l;
-
- for (l = adapters; l != NULL; l = g_slist_next(l)) {
- struct btd_adapter *adapter = l->data;
-
- btd_adapter_set_did(adapter, vendor, product, version);
- }
-}
diff --git a/src/manager.h b/src/manager.h
index 0056909..264cd25 100644
--- a/src/manager.h
+++ b/src/manager.h
@@ -41,4 +41,3 @@ GSList *manager_get_adapters(void);
struct btd_adapter *btd_manager_register_adapter(int id, gboolean up);
int btd_manager_unregister_adapter(int id);
void manager_add_adapter(const char *path);
-void btd_manager_set_did(uint16_t vendor, uint16_t product, uint16_t version);
diff --git a/src/sdpd-service.c b/src/sdpd-service.c
index eb4b74c..ef00760 100644
--- a/src/sdpd-service.c
+++ b/src/sdpd-service.c
@@ -187,9 +187,6 @@ void register_device_id(void)
info("Adding device id record for %04x:%04x:%04x", main_opts.did_vendor,
main_opts.did_product, main_opts.did_version);
- btd_manager_set_did(main_opts.did_vendor, main_opts.did_product,
- main_opts.did_version);
-
record->handle = sdp_next_handle();
sdp_record_add(BDADDR_ANY, record);
--
on behalf of ST-Ericsson
next prev parent reply other threads:[~2012-03-20 16:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-20 16:27 [PATCH V2 1/7] Parse config DeviceID string on bluetoothd startup Szymon Janc
2012-03-20 16:27 ` Szymon Janc [this message]
2012-03-28 9:29 ` [PATCH V2 2/7] Set DeviceID when registering adapter not when sdp server is starting Johan Hedberg
2012-03-20 16:27 ` [PATCH V2 3/7] Add support for setting VID source in DeviceID from config file Szymon Janc
2012-03-20 16:27 ` [PATCH V2 4/7] mgmtops: Add support for setting Device ID Szymon Janc
2012-03-20 16:27 ` [PATCH V2 5/7] btmgmt: " Szymon Janc
2012-03-26 14:45 ` [PATCH V3 " Szymon Janc
2012-03-20 16:27 ` [PATCH V2 6/7] Bump Device ID service version to 1.3 Szymon Janc
2012-03-20 16:27 ` [PATCH V2 7/7] Move common code to sdp to avoid duplication Szymon Janc
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=1332260847-20079-2-git-send-email-szymon.janc@tieto.com \
--to=szymon.janc@tieto.com \
--cc=kanak.gupta@stericsson.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox