bluetooth: Select headset backend through module argument

This patch adds a module argument "headset=ofono|native|auto" to
module-bluetooth-discover and module-bluez5-discover.

To make Arun's happy, the default is 'native' if compiled in, otherwise
'ofono'. 'Auto' will try to autoswitch depending on whether ofono is
running or not.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
David Henningsson 2014-11-10 16:13:13 +01:00
parent d63305f103
commit 9ae85b1a29
4 changed files with 55 additions and 6 deletions

View file

@ -33,6 +33,9 @@ PA_MODULE_AUTHOR("João Paulo Rechi Vita");
PA_MODULE_DESCRIPTION("Detect available Bluetooth daemon and load the corresponding discovery module");
PA_MODULE_VERSION(PACKAGE_VERSION);
PA_MODULE_LOAD_ONCE(true);
PA_MODULE_USAGE(
"headset=ofono|native|auto (bluez 5 only)"
);
struct userdata {
uint32_t bluez5_module_idx;
@ -50,7 +53,7 @@ int pa__init(pa_module* m) {
u->bluez4_module_idx = PA_INVALID_INDEX;
if (pa_module_exists("module-bluez5-discover")) {
mm = pa_module_load(m->core, "module-bluez5-discover", NULL);
mm = pa_module_load(m->core, "module-bluez5-discover", m->argument);
if (mm)
u->bluez5_module_idx = mm->index;
}