summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2012-03-28 12:03:14 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2012-03-28 13:15:28 +0300
commit1ac88d03313b31aec630e221c479e3242781f19b (patch)
tree5d36efd96ce23e8476949e722eb2773845231b33
parente2f915b21efbd39b0cb690d6304c23a8c4eb6254 (diff)
Set DeviceID when registering adapter not when sdp server is starting
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.
-rw-r--r--src/manager.c15
-rw-r--r--src/manager.h1
-rw-r--r--src/sdpd-service.c3
3 files changed, 4 insertions, 15 deletions
diff --git a/src/manager.c b/src/manager.c
index 8c494575..3afc581a 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_source)
+ 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 00569095..264cd250 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 eb4b74c9..ef007601 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);