[PATCH v4 2/8] bluetooth: ofono: Fix asserting when connecting as AG

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 26.04.2017 14:19, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz at intel.com>
>
> Check the card Type property instead of assuming ofono would only be used
> for HF role.
> ---
>   src/modules/bluetooth/backend-ofono.c | 10 ++++++++--
>   1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/src/modules/bluetooth/backend-ofono.c b/src/modules/bluetooth/backend-ofono.c
> index e18772d..3fbf153 100644
> --- a/src/modules/bluetooth/backend-ofono.c
> +++ b/src/modules/bluetooth/backend-ofono.c
> @@ -209,6 +209,7 @@ static void hf_audio_agent_card_found(pa_bluetooth_backend *backend, const char
>       const char *key, *value;
>       struct hf_audio_card *card;
>       pa_bluetooth_device *d;
> +    pa_bluetooth_profile_t p = PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY;
>   
>       pa_assert(backend);
>       pa_assert(path);
> @@ -240,7 +241,12 @@ static void hf_audio_agent_card_found(pa_bluetooth_backend *backend, const char
>           } else if (pa_streq(key, "LocalAddress")) {
>               pa_xfree(card->local_address);
>               card->local_address = pa_xstrdup(value);
> -        }
> +        } else if (pa_streq(key, "Type")) {
> +		if (pa_streq(value, "gateway"))
> +			p = PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT;
> +		else if pa_streq(value, "handsfree")
> +			p = PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY;
> +	}

One more comment: Indention is off and please use space instead of tab.



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux