From 342e06498f9720d9198b006fc0f3a51c21a0c95c Mon Sep 17 00:00:00 2001 From: João Paulo Rechi Vita Date: Fri, 29 Jan 2010 11:01:31 -0200 Subject: bluetooth: add HFP Gateway support Create the 'Handsfree Gateway' profile for bluetooth cards and add filters for 'org.bluez.HandsfreeGateway' to the discover module so module-bluetooth-device is loaded with the correct profile when a Handsfree Gateway connects to bluetoothd (in this case bluetoothd is acting as the headset). --- src/modules/bluetooth/module-bluetooth-discover.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/modules/bluetooth/module-bluetooth-discover.c') diff --git a/src/modules/bluetooth/module-bluetooth-discover.c b/src/modules/bluetooth/module-bluetooth-discover.c index 0085fa8e..fd34c6f7 100644 --- a/src/modules/bluetooth/module-bluetooth-discover.c +++ b/src/modules/bluetooth/module-bluetooth-discover.c @@ -83,8 +83,10 @@ static pa_hook_result_t load_module_for_device(pa_bluetooth_discovery *y, const mi = pa_hashmap_get(u->hashmap, d->path); - if (!d->dead && - d->device_connected > 0 && (d->audio_state >= PA_BT_AUDIO_STATE_CONNECTED || d->audio_source_state >= PA_BT_AUDIO_STATE_CONNECTED)) { + if (!d->dead && d->device_connected > 0 && + (d->audio_state >= PA_BT_AUDIO_STATE_CONNECTED || + d->audio_source_state >= PA_BT_AUDIO_STATE_CONNECTED || + d->hfgw_state > PA_BT_AUDIO_STATE_CONNECTED)) { if (!mi) { pa_module *m = NULL; @@ -119,6 +121,9 @@ static pa_hook_result_t load_module_for_device(pa_bluetooth_discovery *y, const if (d->audio_source_state >= PA_BT_AUDIO_STATE_CONNECTED) args = pa_sprintf_malloc("%s profile=\"a2dp_source\" auto_connect=no", args); + if (d->hfgw_state > PA_BT_AUDIO_STATE_CONNECTED) + args = pa_sprintf_malloc("%s profile=\"hfgw\"", args); + pa_log_debug("Loading module-bluetooth-device %s", args); m = pa_module_load(u->module->core, "module-bluetooth-device", args); pa_xfree(args); -- cgit