From patchwork Tue May 19 20:03:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 11558675 X-Patchwork-Delegate: luiz.dentz@gmail.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B57C4913 for ; Tue, 19 May 2020 20:03:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9CEC320878 for ; Tue, 19 May 2020 20:03:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cuC8/aMn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728400AbgESUDt (ORCPT ); Tue, 19 May 2020 16:03:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728180AbgESUDs (ORCPT ); Tue, 19 May 2020 16:03:48 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4A38C08C5C0 for ; Tue, 19 May 2020 13:03:48 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id x10so336191plr.4 for ; Tue, 19 May 2020 13:03:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=H/drnTK7oqzlA6HKd0xsBjyJ4zbDkXGVCB4bLg2dxp8=; b=cuC8/aMnjTo9zfERyXUIvA0FultotjL2l0UTnk+fDihFYj6TixFThmf+SOADgTdbtL P0J7PqsyHWdak4sdtBnY6r45jX/FUyo9f87a6yDvqc3p4gBq4cP9Nf2ZuX2OVQIm2z// daPhfE4M2O3EA4fuG9wb3KkJutdLttiiVpq5TwinEVrjKhpNo7/n7jnllVaiBpBFTAgA LAfynRL7FPteSkCqQfvXK9yERcR2/uDT9Dtq9E0HRzyJSc85IUGMq7kAFzQYmSM6sxAB UVkvUbiGzUY/7hgyaxLZ0+rVm9TSwIfhlBAyIHQAt4JDlwLLFHIdroZLHP6qJpYTLjdZ Iq4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=H/drnTK7oqzlA6HKd0xsBjyJ4zbDkXGVCB4bLg2dxp8=; b=Mpu/yPafPsIFnI/+rQaM+n295cQKvQwTIosC7PakiKOuicOLgLPM75Lr71dhbs9rqp SCHxGoztBTOkxE7SdXcBkXOEm0aelahIa2TWVheXKY7mGUplRH3ABnvt4m0GzhBWxmBD fgOCH2/OTX2hsaZI9fCboPg9ZyJscPu9q6YbveTd4WgF43sb5FIyXOICC0kZYYdI6QF7 jogY3wPyRygP6zRYy2yiPaJIu5EEew9bK9DjC4ZmVxHP8nLmfqXSHAckxrNBVnqxVD36 lQy8H/rxgcf90+RrmgwqQnM+GSPp5AQ+jDwFDoP2fHi3wnW7ggkTcSsO3R43KUSkvnBf tuMg== X-Gm-Message-State: AOAM531/8vSoNTgm+MBdTO6xI6olduhndTCxW9aAVLS8yzb1EIJ5sHYI 7qzNmi/P8k+g+7jQGLIE5ardBwq5 X-Google-Smtp-Source: ABdhPJyJPVDAlB/VHIJPjjLcxeYBPBYS38piZ7x0OJaA4opEAvWCj5nnOgL8LpR9Iuz02JHGQNlc8A== X-Received: by 2002:a17:90a:e016:: with SMTP id u22mr1320038pjy.28.1589918627489; Tue, 19 May 2020 13:03:47 -0700 (PDT) Received: from localhost.localdomain (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id i98sm302003pje.37.2020.05.19.13.03.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 13:03:46 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v3 1/4] a2dp: Fix caching endpoints for unknown version Date: Tue, 19 May 2020 13:03:42 -0700 Message-Id: <20200519200345.217345-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.25.3 MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz Don't cache the capabilities of endpoints which the version is unknown since so capabilities may not be available in such case. --- profiles/audio/a2dp.c | 11 +++++++++-- profiles/audio/avdtp.c | 7 ++++++- profiles/audio/avdtp.h | 1 + 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c index a2ce3204d..15e211b95 100644 --- a/profiles/audio/a2dp.c +++ b/profiles/audio/a2dp.c @@ -2667,15 +2667,22 @@ static void discover_cb(struct avdtp *session, GSList *seps, struct avdtp_error *err, void *user_data) { struct a2dp_setup *setup = user_data; + uint16_t version = avdtp_get_version(session); - DBG("err %p", err); + DBG("version 0x%04x err %p", version, err); setup->seps = seps; setup->err = err; if (!err) { g_slist_foreach(seps, register_remote_sep, setup->chan); - store_remote_seps(setup->chan); + + /* Only store version has been initialized as features like + * Delay Reporting may not be queried if the version in + * unknown. + */ + if (version) + store_remote_seps(setup->chan); } finalize_discover(setup); diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c index b632e41c5..1fd2be051 100644 --- a/profiles/audio/avdtp.c +++ b/profiles/audio/avdtp.c @@ -2256,7 +2256,7 @@ static uint16_t get_version(struct avdtp *session) const sdp_record_t *rec; sdp_list_t *protos; sdp_data_t *proto_desc; - uint16_t ver = 0x0100; + uint16_t ver = 0x0000; rec = btd_device_get_record(session->device, A2DP_SINK_UUID); if (!rec) @@ -2396,6 +2396,11 @@ struct avdtp *avdtp_new(GIOChannel *chan, struct btd_device *device, return session; } +uint16_t avdtp_get_version(struct avdtp *session) +{ + return session->version; +} + static GIOChannel *l2cap_connect(struct avdtp *session) { GError *err = NULL; diff --git a/profiles/audio/avdtp.h b/profiles/audio/avdtp.h index ad2cb9bcb..f1e51d4e3 100644 --- a/profiles/audio/avdtp.h +++ b/profiles/audio/avdtp.h @@ -310,3 +310,4 @@ struct avdtp_server *avdtp_get_server(struct avdtp_local_sep *lsep); struct avdtp *avdtp_new(GIOChannel *chan, struct btd_device *device, struct queue *lseps); +uint16_t avdtp_get_version(struct avdtp *session); From patchwork Tue May 19 20:03:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 11558677 X-Patchwork-Delegate: luiz.dentz@gmail.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B641590 for ; Tue, 19 May 2020 20:03:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9241E20878 for ; Tue, 19 May 2020 20:03:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="T5kmOdBv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728416AbgESUDu (ORCPT ); Tue, 19 May 2020 16:03:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728372AbgESUDu (ORCPT ); Tue, 19 May 2020 16:03:50 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FDDBC08C5C0 for ; Tue, 19 May 2020 13:03:50 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id q9so156481pjm.2 for ; Tue, 19 May 2020 13:03:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=zy3uJZB5XsJzztjORyRIanJypmSXB+lz2legdKKnj/A=; b=T5kmOdBvKJdlquQDk4QJiXFzQ66l4U4TUzHo7hgylFqLobn+RomJ7Ejj9Rgh2H+JZD ViE99NBvPRWtBeWd8qQUeiiDBXREBIS90yXGNtWgG9/u4/d91eQ9wDp9LDWcoN97GZI5 PpPzwi2NCSKS4PYaKNK4BbZWmYXriotgDDNRd/NXTHO8TZlDVdGfcsB4vyP1d0Clo60U p2jE6MITKkUJFu98wD/SoRY+A1d5zabBbS6ZOgih45DPBEiGWkUHHig2w1yqrzcDSZ08 iruqvE+QouD56HMJwNkKn+Cgz+9XThEIN/csuxwrZJyhmWBOfWSd1KP8eY5buRE0n9Lh Pz5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zy3uJZB5XsJzztjORyRIanJypmSXB+lz2legdKKnj/A=; b=ZWGke3V1fEV1L6ligczi+pBTcbeXs4+Dnv7qS0RBY6KWtfn009lzIXprE0s6PmRYmC TjTmwS8IFyO1/nTelaH1vrm9Ss4Zit/wUjLRgcKXCGpdFQYQwsjk+JGIe7JMIgTSwyZp Xi2Z13mywwS3I3cT607sYHKGsN+RkCXLsPpl5XMyj/0igZbaiCOwkakxHm6/9oyydQDa n8q8rng/eCaxXWFWKbtpb1W8UEp/ZJCB9gNI0AWk58nSTEXq8TL9hB2ifQpY3nYdFWEU frLBI/P1b5nbEcylbrhDGKQ9pkLQhZiAWpJ7KElrRiezQj8KqHROh4nYdQDYq5ZEG1ea tDpA== X-Gm-Message-State: AOAM533lb79uUgaxW1AtWX9ZbSha110i5aLZNzSUjdQCHeNy/nEFZESu nyQOnrkTbVqRcCwPRVRjI1gRcBHx X-Google-Smtp-Source: ABdhPJwO25ZX/K2n8e8lWPQBCWYphQHoLF3MvgXpa3moZni4YCFy+TpFLtRfcy4+nVO+NbHq4WkveQ== X-Received: by 2002:a17:90b:30c5:: with SMTP id hi5mr1255532pjb.110.1589918629145; Tue, 19 May 2020 13:03:49 -0700 (PDT) Received: from localhost.localdomain (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id i98sm302003pje.37.2020.05.19.13.03.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 13:03:47 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v3 2/4] doc/media-api: Add documentation for DelayReporting Date: Tue, 19 May 2020 13:03:43 -0700 Message-Id: <20200519200345.217345-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.25.3 In-Reply-To: <20200519200345.217345-1-luiz.dentz@gmail.com> References: <20200519200345.217345-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz The code was expecting the endpoint to expose MediaEndpoint.DelayReporting property in order to expose MediaTransport.Delay property. --- doc/media-api.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/media-api.txt b/doc/media-api.txt index 07f7ac3e0..dabc69936 100644 --- a/doc/media-api.txt +++ b/doc/media-api.txt @@ -580,6 +580,10 @@ Properties string UUID [readonly, optional]: Device object which the endpoint is belongs to. + bool DelayReporting [readonly, optional]: + + Indicates if endpoint supports Delay Reporting. + MediaTransport1 hierarchy ========================= From patchwork Tue May 19 20:03:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 11558679 X-Patchwork-Delegate: luiz.dentz@gmail.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 37B8F90 for ; Tue, 19 May 2020 20:03:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1BA3120878 for ; Tue, 19 May 2020 20:03:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UtUsItoL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728371AbgESUDw (ORCPT ); Tue, 19 May 2020 16:03:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728180AbgESUDv (ORCPT ); Tue, 19 May 2020 16:03:51 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8AA4C08C5C0 for ; Tue, 19 May 2020 13:03:51 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id u5so330531pgn.5 for ; Tue, 19 May 2020 13:03:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=7D9EFlaSozxQQG860B6qvAmqHWXJSaodmFPvorrsbq4=; b=UtUsItoLYijolBbIqKBuS/+nYePfcLxLmRoeKbWPfUMyQymEjqjt7PGngNQjISBVyx yET7TKDO9yLZmIVd4GRQtzGIIa5Lx9eSvEIZIBHFgayTjRu2G5Hns3KmnUz6YsArqJ7H 9xkVBMrGXPD3fWX7FV/UKY0sNzPxSvnjh4lsBk7I06giy8ZyLJsnEdVxxt7oyqbvtr/x WlsYJ9qr6SOr68/BU0E+dotSbx6AeAe58UGOkmEAd2JUTJOIMIo3IFauMOcD+Hgp6rcj +/RyNFjNRL1hUv02/9DuP27CfyFyI5fSCqgF1gCxr6dxZXKZsCzNl2bdj2gHTa7B4cbF s+nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7D9EFlaSozxQQG860B6qvAmqHWXJSaodmFPvorrsbq4=; b=e0nmVDCbUEacXq5FbTHl0uUuN179sG88xkBcl40WY4GfaPDTflD8E8soYsaEL6TyIP W7vUwOTrwvrFcPvj8zC36xd940FyUkiIbJPC9ejjKAr6oZeTHKUbBrLDu3b9Wbf+avi9 yAGtCHoQ/49c+8kQzIaR90NGi4s94GOY1I+i5lBm7YkCvJdLp4hMBaOA+30u4dkC+AqZ U4oCA64ucJ0lYOV5kG2vOWfC9Q1xAwiXk8+rZ7MCfNSCoCjpeML6rkE6Gngsij2V2/4f q7rZkPCCCUcY53OTtspdvCNmlhAMPvVleTOpRAXUtmz2nnKvSWL2PDG1n/kNLQN99E+m Q7oA== X-Gm-Message-State: AOAM533gS6KsTmvPj09poFF6tDt7QQlKE/y6vAP6KvWW4NsYMAnRIYrQ KkMh/Ob8f6Wvxob8aZ7rXipYxNbr X-Google-Smtp-Source: ABdhPJxAMnHSatv8KDX9thc24tTT+Ngh3bYCzUl1zuatFQJpR5pRvnQ3zXExEdbGQTFbv9ZnbMxUMA== X-Received: by 2002:a62:cf87:: with SMTP id b129mr781248pfg.241.1589918630638; Tue, 19 May 2020 13:03:50 -0700 (PDT) Received: from localhost.localdomain (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id i98sm302003pje.37.2020.05.19.13.03.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 13:03:49 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v3 3/4] a2dp: Store Delay Reporting capability Date: Tue, 19 May 2020 13:03:44 -0700 Message-Id: <20200519200345.217345-3-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.25.3 In-Reply-To: <20200519200345.217345-1-luiz.dentz@gmail.com> References: <20200519200345.217345-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz This stores Delay Reporting capability so it is properly restored when loading from cache. --- profiles/audio/a2dp.c | 46 ++++++++++++++++++++++++++++++++---------- profiles/audio/avdtp.c | 13 ++++++++++-- profiles/audio/avdtp.h | 5 ++++- 3 files changed, 50 insertions(+), 14 deletions(-) diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c index 15e211b95..0d877b132 100644 --- a/profiles/audio/a2dp.c +++ b/profiles/audio/a2dp.c @@ -1847,11 +1847,25 @@ static gboolean get_device(const GDBusPropertyTable *property, return TRUE; } +static gboolean get_delay_reporting(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct a2dp_remote_sep *sep = data; + dbus_bool_t delay_report; + + delay_report = avdtp_get_delay_reporting(sep->sep); + + dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &delay_report); + + return TRUE; +} + static const GDBusPropertyTable sep_properties[] = { { "UUID", "s", get_uuid, NULL, NULL }, { "Codec", "y", get_codec, NULL, NULL }, { "Capabilities", "ay", get_capabilities, NULL, NULL }, { "Device", "o", get_device, NULL, NULL }, + { "DelayReporting", "b", get_delay_reporting, NULL, NULL }, { } }; @@ -1942,6 +1956,7 @@ static void load_remote_sep(struct a2dp_channel *chan, GKeyFile *key_file, for (; *seids; seids++) { uint8_t type; uint8_t codec; + uint8_t delay_reporting; GSList *l = NULL; char caps[256]; uint8_t data[128]; @@ -1955,11 +1970,17 @@ static void load_remote_sep(struct a2dp_channel *chan, GKeyFile *key_file, if (!value) continue; - if (sscanf(value, "%02hhx:%02hhx:%s", &type, &codec, + /* Try loading with delay_reporting first */ + if (sscanf(value, "%02hhx:%02hhx:%02hhx:%s", &type, &codec, + &delay_reporting, caps) != 4) { + /* Try old format */ + if (sscanf(value, "%02hhx:%02hhx:%s", &type, &codec, caps) != 3) { - warn("Unable to load Endpoint: seid %u", rseid); - g_free(value); - continue; + warn("Unable to load Endpoint: seid %u", rseid); + g_free(value); + continue; + } + delay_reporting = false; } for (i = 0, size = strlen(caps); i < size; i += 2) { @@ -1979,7 +2000,8 @@ static void load_remote_sep(struct a2dp_channel *chan, GKeyFile *key_file, caps_add_codec(&l, codec, data, size / 2); - rsep = avdtp_register_remote_sep(chan->session, rseid, type, l); + rsep = avdtp_register_remote_sep(chan->session, rseid, type, l, + delay_reporting); if (!rsep) { warn("Unable to register Endpoint: seid %u", rseid); continue; @@ -2605,7 +2627,7 @@ static struct queue *a2dp_select_eps(struct avdtp *session, uint8_t type, static void store_remote_sep(void *data, void *user_data) { struct a2dp_remote_sep *sep = data; - GKeyFile *key_file = (void *) user_data; + GKeyFile *key_file = user_data; char seid[4], value[256]; struct avdtp_service_capability *service = avdtp_get_codec(sep->sep); struct avdtp_media_codec_capability *codec = (void *) service->data; @@ -2614,13 +2636,13 @@ static void store_remote_sep(void *data, void *user_data) sprintf(seid, "%02hhx", avdtp_get_seid(sep->sep)); - offset = sprintf(value, "%02hhx:%02hhx:", avdtp_get_type(sep->sep), - codec->media_codec_type); + offset = sprintf(value, "%02hhx:%02hhx:%02hhx:", + avdtp_get_type(sep->sep), codec->media_codec_type, + avdtp_get_delay_reporting(sep->sep)); for (i = 0; i < service->length - sizeof(*codec); i++) offset += sprintf(value + offset, "%02hhx", codec->data[i]); - g_key_file_set_string(key_file, "Endpoints", seid, value); } @@ -2644,7 +2666,8 @@ static void store_remote_seps(struct a2dp_channel *chan) key_file = g_key_file_new(); g_key_file_load_from_file(key_file, filename, 0, NULL); - data = g_key_file_get_string(key_file, "Endpoints", "LastUsed", NULL); + data = g_key_file_get_string(key_file, "Endpoints", "LastUsed", + NULL); /* Remove current endpoints since it might have changed */ g_key_file_remove_group(key_file, "Endpoints", NULL); @@ -2652,7 +2675,8 @@ static void store_remote_seps(struct a2dp_channel *chan) queue_foreach(chan->seps, store_remote_sep, key_file); if (data) { - g_key_file_set_string(key_file, "Endpoints", "LastUsed", data); + g_key_file_set_string(key_file, "Endpoints", "LastUsed", + data); g_free(data); } diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c index 1fd2be051..45727f01e 100644 --- a/profiles/audio/avdtp.c +++ b/profiles/audio/avdtp.c @@ -3210,6 +3210,11 @@ struct avdtp_service_capability *avdtp_get_codec(struct avdtp_remote_sep *sep) return sep->codec; } +bool avdtp_get_delay_reporting(struct avdtp_remote_sep *sep) +{ + return sep->delay_reporting; +} + struct avdtp_service_capability *avdtp_service_cap_new(uint8_t category, void *data, int length) { @@ -3229,7 +3234,8 @@ struct avdtp_service_capability *avdtp_service_cap_new(uint8_t category, struct avdtp_remote_sep *avdtp_register_remote_sep(struct avdtp *session, uint8_t seid, uint8_t type, - GSList *caps) + GSList *caps, + bool delay_reporting) { struct avdtp_remote_sep *sep; GSList *l; @@ -3244,6 +3250,7 @@ struct avdtp_remote_sep *avdtp_register_remote_sep(struct avdtp *session, sep->type = type; sep->media_type = AVDTP_MEDIA_TYPE_AUDIO; sep->caps = caps; + sep->delay_reporting = delay_reporting; for (l = caps; l; l = g_slist_next(l)) { struct avdtp_service_capability *cap = l->data; @@ -3252,7 +3259,9 @@ struct avdtp_remote_sep *avdtp_register_remote_sep(struct avdtp *session, sep->codec = cap; } - DBG("seid %d type %d media %d", sep->seid, sep->type, sep->media_type); + DBG("seid %d type %d media %d delay_reporting %s", sep->seid, sep->type, + sep->media_type, + sep->delay_reporting ? "true" : "false"); return sep; } diff --git a/profiles/audio/avdtp.h b/profiles/audio/avdtp.h index f1e51d4e3..011fea89e 100644 --- a/profiles/audio/avdtp.h +++ b/profiles/audio/avdtp.h @@ -226,7 +226,8 @@ struct avdtp_service_capability *avdtp_service_cap_new(uint8_t category, struct avdtp_remote_sep *avdtp_register_remote_sep(struct avdtp *session, uint8_t seid, uint8_t type, - GSList *caps); + GSList *caps, + bool delay_reporting); uint8_t avdtp_get_seid(struct avdtp_remote_sep *sep); @@ -234,6 +235,8 @@ uint8_t avdtp_get_type(struct avdtp_remote_sep *sep); struct avdtp_service_capability *avdtp_get_codec(struct avdtp_remote_sep *sep); +bool avdtp_get_delay_reporting(struct avdtp_remote_sep *sep); + int avdtp_discover(struct avdtp *session, avdtp_discover_cb_t cb, void *user_data); From patchwork Tue May 19 20:03:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 11558681 X-Patchwork-Delegate: luiz.dentz@gmail.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8A8FD90 for ; Tue, 19 May 2020 20:03:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7388F20872 for ; Tue, 19 May 2020 20:03:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qe2d0p4D" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728392AbgESUDx (ORCPT ); Tue, 19 May 2020 16:03:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728180AbgESUDx (ORCPT ); Tue, 19 May 2020 16:03:53 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32A3FC08C5C0 for ; Tue, 19 May 2020 13:03:53 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id n18so418259pfa.2 for ; Tue, 19 May 2020 13:03:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=3vOmxRIz18xqHnh7KqZs026Bkg3/EflDmf6PCja04AI=; b=qe2d0p4DqcsqJuwAZaKUbbEpw4CWfY5iH8qCEk+3OfXYoKHSE3mEeMP3/4vpPnSOq/ qYjn3Vj6hf1b/e2ibUMJ1mAvW6yfrqOGThwb1Da3T7vYF2xl2USA6UrN4dYPCes+HMBu S6/mgXigmCvpGoJZXl03pLi/6UzWkOoJH9E7U9KKcC6LkZATPZ1Koc6LxViw9QtiYOrx ItBQTRZcHxPGZ/J/b2QP6da1euh4E3f7tV5shsvMkCQPFyPDDTwCbFwAS22YZUyxDGaO P+gnz/KLz4t+sKRXb1mRMAoeGQN51A56iuNpC8nK7T729UkeowhTwoA+T1QGIVSoY2Q4 e0kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3vOmxRIz18xqHnh7KqZs026Bkg3/EflDmf6PCja04AI=; b=meVVTQ/W21EtLtx6/dBDEDyU9ypEfWYuJfKidQGJnbgN7dh1/XLZTTAi6/Bejlw3cT r5ggggyTOMMYnjjtv+kVUGMcNuq4rPJ0mt3rgsKDGFePye44yJslHmoG94jYpwLpsfwE r81GPDFuyz+cUUmYiBSKTFhtRAnto6drKoJgvuZT1UUCyqKnN4+JEkIBGRl3zjk3vObE t9WGsdyqRVpe7BoFFkE74lb+Nb+57J01GNJkkSELzHtfaClaxgjsxmvWczK6vDGJITfa oyrcYvY5plqy4PjcbxSRmzHcZT8L+vjwnIjQY9qtkXSyn7OPFcjLDlWJeW+hDMMMfrRq Nncw== X-Gm-Message-State: AOAM533Ue3+x1hWqasvtUZEcNAvS5WiPCHoZan2Q66XulL6N3kd/mz8q PNAd3VtmUBx05pvMo+zTBcXxVWn0 X-Google-Smtp-Source: ABdhPJz4DLCXwmAWF1gocd/W3quyXkdhNyZOKB3W9U6Ygfh9HO4TJl2iP6U3ucYoSZ1iXGlFsYG6uw== X-Received: by 2002:a63:f015:: with SMTP id k21mr868327pgh.248.1589918632118; Tue, 19 May 2020 13:03:52 -0700 (PDT) Received: from localhost.localdomain (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id i98sm302003pje.37.2020.05.19.13.03.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 13:03:51 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v3 4/4] doc/settings-storage: Update documentation of Endpoints Date: Tue, 19 May 2020 13:03:45 -0700 Message-Id: <20200519200345.217345-4-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.25.3 In-Reply-To: <20200519200345.217345-1-luiz.dentz@gmail.com> References: <20200519200345.217345-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz Add documentation of DelayReporting storage as that has been added to the cache. --- doc/settings-storage.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/settings-storage.txt b/doc/settings-storage.txt index 5f6d25141..d21150f09 100644 --- a/doc/settings-storage.txt +++ b/doc/settings-storage.txt @@ -218,9 +218,10 @@ Sample Attributes section: [Endpoints] group contains: - :: String First field is the endpoint type, - followed by codec type and its - capabilies as hexadecimal encoded + :::: String First field is the endpoint type, + followed by codec type and delay + reporting and its + capabilities as hexadecimal encoded string. LastUsed:: String LastUsed has two fields which are the local and remote seids as hexadecimal