[pulseaudio-discuss] [RFC v0 06/15] bluetooth: Add HFP 1.6 codec ID

Tanu Kaskinen tanuk at iki.fi
Sun Dec 30 06:29:58 PST 2012


On Wed, 2012-12-19 at 13:58 +0100, Mikel Astiz wrote:
> From: Vinicius Costa Gomes <vinicius.gomes at openbossa.org>
> 
> According to the HFP 1.6 spec, the default codec (CVSD) has ID 0x01.
> 
> This change has no effect in older versions of BlueZ since the codec ID
> was ignored for HFP, due to the fact that HFP versions prior to 1.6 do
> not have such a field.
> ---
>  src/modules/bluetooth/bluetooth-util.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
> index bf31f28..67b3240 100644
> --- a/src/modules/bluetooth/bluetooth-util.c
> +++ b/src/modules/bluetooth/bluetooth-util.c
> @@ -814,7 +814,7 @@ finish:
>  static void register_endpoint(pa_bluetooth_discovery *y, const char *path, const char *endpoint, const char *uuid) {
>      DBusMessage *m;
>      DBusMessageIter i, d;
> -    uint8_t codec = 0;
> +    uint8_t codec;
>  
>      pa_log_debug("Registering %s on adapter %s.", endpoint, path);
>  
> @@ -830,14 +830,18 @@ static void register_endpoint(pa_bluetooth_discovery *y, const char *path, const
>  
>      pa_dbus_append_basic_variant_dict_entry(&d, "UUID", DBUS_TYPE_STRING, &uuid);
>  
> -    pa_dbus_append_basic_variant_dict_entry(&d, "Codec", DBUS_TYPE_BYTE, &codec);
>  
>      if (pa_streq(uuid, HFP_AG_UUID) || pa_streq(uuid, HFP_HS_UUID)) {
>          uint8_t capability = 0;
> +
> +        codec = 1;

The Codec property type is an enumeration by its nature, isn't it? I
think we should have an enum for this.

-- 
Tanu



More information about the pulseaudio-discuss mailing list