diff options
author | Daniel Orstadius <daniel.orstadius@nokia.com> | 2010-11-30 13:27:57 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2010-11-30 13:50:12 +0200 |
commit | ec31eb74a9e7d89cb8f6c4221ed337368ef1eef4 (patch) | |
tree | c22faf45b8cc904174415261df760e0ddb761317 /src/sdpd-database.c | |
parent | 5f9ebfaa84eacb59a47bcdd6c9479d8b94552414 (diff) | |
download | bluez-ec31eb74a9e7d89cb8f6c4221ed337368ef1eef4.tar.gz |
Initialize adapter services list
In case service records have been added to bluetoothd before a new
adapter is registered, the records which are shared by all adapters
(indicated by having the address set to BDADDR_ANY) need to be added
to the services list of the new adapter. This patch adds a function
for this on adapter initialization.
The issue could be reproduced by running bluetoothd and obexd on a
PC and briefly removing the BT dongle. The service records from
obexd would not be present in the adapter's local list (which is
used to set the class of device).
Diffstat (limited to 'src/sdpd-database.c')
-rw-r--r-- | src/sdpd-database.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/sdpd-database.c b/src/sdpd-database.c index da3bc7de3..882d567eb 100644 --- a/src/sdpd-database.c +++ b/src/sdpd-database.c @@ -306,3 +306,26 @@ uint32_t sdp_next_handle(void) return handle; } + +void sdp_init_services_list(bdaddr_t *device) +{ + sdp_list_t *p; + + SDPDBG(""); + + for (p = access_db; p != NULL; p = p->next) { + sdp_access_t *access = p->data; + sdp_record_t *rec; + + if (bacmp(BDADDR_ANY, &access->device)) + continue; + + rec = sdp_record_find(access->handle); + if (rec == NULL) + continue; + + SDPDBG("adding record with handle %x", access->handle); + + adapter_service_insert(device, rec); + } +} |