Re: [PATCH v3 06/14] AVRCP: Keep AVRCP version of connected device in session

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

 



Hi Michal,

On Thu, Jun 28, 2012 at 1:22 PM, Michal Labedzki
<michal.labedzki@xxxxxxxxx> wrote:

> +               rec_tg = btd_device_get_record(dev->btd_dev, AVRCP_TARGET_UUID);
> +               rec_ct = btd_device_get_record(dev->btd_dev, AVRCP_REMOTE_UUID);
> +
> +               if (rec_tg && sdp_get_profile_descs(rec_tg, &list) >= 0) {
> +                       desc = list->data;
> +                       if (desc)
> +                               server->session.version_tg = desc->version;
> +                       else
> +                               server->session.version_tg = VERSION_UNKNOWN;
> +                       sdp_list_free(list, free);
> +               }
>
> -               if (sdp_get_profile_descs(rec, &list) < 0)
> -                       return;
> +               if (rec_ct && sdp_get_profile_descs(rec_ct, &list) >= 0) {
> +                       desc = list->data;
> +                       if (desc)
> +                               server->session.version_ct = desc->version;
> +                       else
> +                               server->session.version_ct = VERSION_UNKNOWN;
> +                       sdp_list_free(list, free);
> +               }

Maybe we should create a helper function to get the version e.g int
sdp_get_profile_version(rec, uuid, &version)

> @@ -1335,6 +1354,9 @@ int avrcp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config)
>
>         bacpy(&server->src, src);
>
> +       server->session.version_tg = VERSION_UNKNOWN;
> +       server->session.version_ct = VERSION_UNKNOWN;
> +

I guess we can start with 1.0, so if we are unable to read the version
(which probably indicates a malformed record) we should use 1.0 by
default.

-- 
Luiz Augusto von Dentz
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux