bluetooth: Extend discovery to support multiple hooks

Add the infrastructure to support several hooks inside
pa_bluetooth_discovery, while using hook names that describe more
accurately their purpose.
This commit is contained in:
Mikel Astiz 2012-12-06 15:55:27 +01:00 committed by Tanu Kaskinen
parent c8944dbb4b
commit e425fd61b8
4 changed files with 28 additions and 13 deletions

View file

@ -2660,11 +2660,12 @@ int pa__init(pa_module* m) {
if (!(device = find_device(u, address, path)))
goto fail;
u->discovery_slot = pa_hook_connect(pa_bluetooth_discovery_hook(u->discovery), PA_HOOK_NORMAL,
(pa_hook_cb_t) discovery_hook_cb, u);
u->device = device;
u->discovery_slot =
pa_hook_connect(pa_bluetooth_discovery_hook(u->discovery, PA_BLUETOOTH_HOOK_DEVICE_CONNECTION_CHANGED),
PA_HOOK_NORMAL, (pa_hook_cb_t) discovery_hook_cb, u);
u->uuid_added_slot = pa_hook_connect(&device->hooks[PA_BLUETOOTH_DEVICE_HOOK_UUID_ADDED], PA_HOOK_NORMAL,
(pa_hook_cb_t) uuid_added_cb, u);