From patchwork Fri Mar 8 16:52:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silviu Florian Barbulescu X-Patchwork-Id: 778921 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2087.outbound.protection.outlook.com [40.107.8.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ABA6B179B1 for ; Fri, 8 Mar 2024 16:52:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.8.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709916762; cv=fail; b=ljHUXClBvbf4t6cWrr8h1goPPCH4NWko6FAB5vCnps6kwyMOdHXzoomSIEKdcICL5eNRHd+vfJ9ad8fgLP2ExDkygB9A+aaDee5ouPBB6j9jLesFyG4uX5sRoc19p4Qa67TynBI4ByfAatIyZDiSevMvaoAL/sBp3pPqMclAB20= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709916762; c=relaxed/simple; bh=LNJ6IKQIILL4QpQTAFV7m7uPFR+Y6rINoH0O64d8wUs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=EazJ80HVa7AqkRwDJ1dDpmEAbJqBmuipkRNBlroXSEcce9praBLJSJsvBpzdSJ8Tjxcu7jDNeXsp7Wy8w2QUZK1M65JyqLHSvWRwaTpxvDAvxaK2zpx98mILHJAJXssG1R7Lcq6aFey/r6rLpzaxKmKJZANRsq1MSCtPyLBc5qI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=bbLvYNuZ; arc=fail smtp.client-ip=40.107.8.87 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="bbLvYNuZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GUWB+yGwv3SmB/SDp756qFt4q5P6AU2Vmn4N2cpKBpnwJ+ZtZkwvagyBLNnAv55frJEwNKyIt7NQ4nBGZw/3KYMQEbsaF5KRP66ACTBhhmvQFZK262yHcnU5qmEiDFnHhsNX8uW7BlZzpw8zrAbsUO5szAjJGMfX4AMqrhgOi1oHWh8Yr1gclDCy380ZMHEfFyYbjWhVbXON6TCLrLrkCMaXRQKcfeHOruNzxBIhmOnfB8MNJ4SsbdZCmectWAwlPA9tbJrP83HZ1kr2uvqdEBQm7rAD0fmAknwLlU0xr63c8A1aXNUp4Xh/DrLpw7NfJoZzkX3DwxT0McMzKX2JwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EJYPo4BDEQehzyDUUeCbu4wXD1MJpd0C1mIihRuBq8c=; b=DzYsSReLW0hZ8uyUjUgZ6wCiCvnX+Yi76+g9MdJApb2PHIU0flZqcNHeBfKO+W4ymGDTiskzyJg2Svt/bCOfjWm3B5jJaoAtQ7xbZB1Z0UWaH0XcooQ/D4I/gV25JUbPxeArggvL8urelEIgYJiBUbfPY41TvdnULuL5VMYIrubk4xQhA/kSgo6R7j4RtQE91/UKmdAikxVnWZrRwi7Vx+0uuKUMqDOMFNQP5XD8bwAesaaCUOQfMruohCsdzErk+FhNxIvyZNg/jfC5zEq7YFdliLAFfRD4x0kxBes7McNL94Vl/QYS7VPcOIDQRNyPANXzB+uyHTBkSOktQers3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EJYPo4BDEQehzyDUUeCbu4wXD1MJpd0C1mIihRuBq8c=; b=bbLvYNuZsT6RKPfKl+IJmsJzb4l7Gia+zPeuY5F7i4aCj/JEbOMyR+9+To51uBbvAzIXHzbiRNMwCax/We4d3SQcUOZ38DDEYych6jtkygBFB5x/Vd4owiekHPfr5e7Uit31SxH8zJMyuPc9aP8SuCKKiI2w428AGjeBtqj4M3s= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) by AM9PR04MB7572.eurprd04.prod.outlook.com (2603:10a6:20b:2d4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.27; Fri, 8 Mar 2024 16:52:37 +0000 Received: from VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::7bc8:c6eb:cb72:91cf]) by VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::7bc8:c6eb:cb72:91cf%5]) with mapi id 15.20.7362.019; Fri, 8 Mar 2024 16:52:37 +0000 From: Silviu Florian Barbulescu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, iulia.tanasescu@nxp.com Subject: [PATCH BlueZ 1/3] player: Add reconfiguration prompt for broadcast source Date: Fri, 8 Mar 2024 18:52:30 +0200 Message-Id: <20240308165232.53906-2-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240308165232.53906-1-silviu.barbulescu@nxp.com> References: <20240308165232.53906-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AS4PR09CA0001.eurprd09.prod.outlook.com (2603:10a6:20b:5e0::7) To VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB10073:EE_|AM9PR04MB7572:EE_ X-MS-Office365-Filtering-Correlation-Id: c07e5b71-f9d3-4624-efec-08dc3f9028fe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nL4n+npWvLld37Lm0elP2Lb4maPHM2+RQ8qFxR5OT6FoZzsbAt5P+qzhzMwKPmSkWmk00StZd+jaz6n6qOdO/Ke26WZ/742/oRKRAMMAQKWTbnaa7LSEN0DuVRP0wUuUoz4Yr9B0qYiYry79EEkD8VPZZRcHGEmCypA9QjkN9DWCNsN+3DACdEELuMjljN9KaUV1P2IkYgMhW/Gvmr+ulBGlibzyNoBPIwaDvd2KwWHpJoyKzs9SOBbWQF+uZr6Yk80M4UxZVSq8F7aLw2TWi5dR4JfeyAn3mlBa6rg6+4PDnvh20t/f5clD4bRu+sLBvrmVhNYVMSmsD397M1yVRQe5MZgnZja/8Hs86XmGh06K0DsSHP2NWFQU2RFYUFt06nh49NLWuD9JNO1zus8vTyJGf4QNWpu41zt+r/vI8c9AblRvbuGyw5mcYcMX4yoCCBCgYeL4UGPv8J4E8A+B9Nptk4ARxzGn5jZVzf1b+RemX/XYVAmdDv3v8ECVuC1Qyx2nC4yfFPlCcSCjRWm6ZFUqjqS3tIFrfdaaTO+qk7QXPW8hDIqdThUeQqp+o/0mJk2QFNseaSh+L1oF4i56G6TByYUA1PcfqovTKNJijODlXcoH20cjXQHAWt3e72NaT8ph1k6ZXg0yU0qm2xAXnR+xhV69TrACDSvDPg8EhWI= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB10073.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(1800799015)(376005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: D8AhBZuqMjaGPS0PixkVkBWPuGKQjrLo0RXGGWfMU2ytW3F1rJkoH7I1KCTP8OFDkTLaTWp9780LnoWEBZNCuptVQcwNdmT6nucpHnNtE10vYNXXuBRW9h+sQ14rHriXf5HtBBrra8jYm6TkQvuCtqk94nbkrPH04xF7lA+aqdAc59vVehsLHRUESADPY/P6TNS3n4iuuOtIizk5X6mSUtIMyPsPXN8v1E2EYjqn5tVj9cy5UwAGMDr8qScWtIFB6bpZruxbJ2OFNsotgv1VGM4d2eOg/34ZTDB8NzAbX232jB+tKaCi7f00M+PgvVDEDiAQiSmjMbG3yMU5IFvWU4gjKtYsLGtiOdiaa7UtCOiUsHwz9h8C9hzob6wl3sdOckRyW0l7xWeOao6DdPjIkp8Z3gfQ4NTIhhMDRJLRR0/vJGWLBwsE1HyY3KvjcuTIaa/KqlqBcYorghqXnu+TfGQ69NVNs3OcdpfrHOQb7SSE4CXHotMfRZKV7/mNYG3lohBaNAme4UaaHVzQFNIkf74DG1gZmeerSTHnd5HHA/mLlqzqDj830034tTmPzNDqbW/VTuJWKhEZ4Y7u0tyJPwaEbSG3PUFLs+uqXQ/MkVivWIWLMz0p45BEFRwxjJ2Qs8SzcIvtmaxs5SjIXk/OmK/Rdzf+Jj+bNFgy+I4iqYXVSoASsLLtqgRrQGLEQcBV5t1alWMngQM0qRLX9xYIByUNCDF9IkIoo2rtt0VEiWQwEo70ChrN+yxwP2RhGX4/Mr9GciFPpWsqDOfvcWP6ww54pKlX82ittKTfDvTkpAdMGnv4KOh4qKZUT2pXIImq+n97ZJWrRRDzNnDu86O1qtPtCMk27oQrFmoRo5nPKICeSThZyp29/I45M6rCvCu3lvUUBvCI424EEtWo3Hqsa7Qwi5bzFu/MonWZA1v8segVa7KbChev9CUPYOMMGuXzJUe0SM2zBEtcL5IR9Clz2uUgfmumnzNBKM5PFzcJ1oYvcLlPXgqaDePQPFtB5vkxztDAj9Uk4DIHIm/F3CY5hK0M+Z53GUsnTd0dEjOwjeAon6JttcoL0wBFD0thMGvZw/5Ml0U5vmTill3r2lXiLWB7zDhUPtFZNZE8X72mLoEkLlb7DpyGL74O/7CSzJlvdgXKqM1jGbkM544Q7e/4b5+TyFzB/i6KHGl0Mi1RWWShYFLqXEDdolny0LAurBDacadyM/coyShDg8u86s/+7iTcxwVp/qpJU9amiDSRQ1z9KfRWpZ1mzxPwmxHTS7qGQ5xH1l68CU9Vhm2918XL7b5SQ9mpCBMj4cPJ4FXRH5k3bo0nWhtWGVMjR0DjVNWQpo20ltIfWAOVNf2s+iMcVwYhKqyMsVE8nZkvCG5tqb4CMgW/yegR0ff11cLPoSyMeAa8ojpQ1SKtuvhoEXKmyAsI2ACyT0VO2EW/S4kXqsZSOrdft//4Sy0uDx8hGrAhD1KCiisLa3Z8tKHrtP2D09l7SROVxhJ+QfLuhP+8CXG02kjpRzTRKSqet86wZ4aDGOjWVoeoJWaFeczdRuXYV4G/+8H0NcUncO64yPTZiQqe/BmrnUvpD60rg/8weNfUgKR4vZ6+0rSl/8qJ4En9Dg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c07e5b71-f9d3-4624-efec-08dc3f9028fe X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2024 16:52:37.6540 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lLb+6dtlO9REmIrOyXYD7fCApSPcaIjmVGDKIz8GzVKDv1eXm6X79lfTwX7AIYEJqW9Zg74SPny2uzH7kO3W59j+ShxboyzygIrH0XtzAqQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB7572 endpoint.config /org/bluez/hci0/pac_bcast0 /local/endpoint/ep0 48_4_1 [/local/endpoint/ep0] This is a BIS Reconfiguration? (yes/no): y The BIS index is assigned in the order of the configuration starting with 1 [/local/endpoint/ep0] BIS Index (value): 1 [/local/endpoint/ep0] BIG (auto/value): 0 [/local/endpoint/ep0] Enter channel location (value/no): 2 [/local/endpoint/ep0] Enter Metadata (value/no): n --- client/player.c | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/client/player.c b/client/player.c index a40bf66e3..35143115a 100644 --- a/client/player.c +++ b/client/player.c @@ -3809,6 +3809,48 @@ static void config_endpoint_iso_group(const char *input, void *user_data) } } +static void endpoint_set_reconfigure_cfg(const char *input, void *user_data) +{ + char *endptr = NULL; + int value; + struct endpoint_config *cfg = user_data; + + value = strtol(input, &endptr, 0); + + if (!endptr || *endptr != '\0' || value > UINT8_MAX) { + bt_shell_printf("Invalid argument: %s\n", input); + return bt_shell_noninteractive_quit(EXIT_FAILURE); + } + + cfg->ep->iso_stream = value; + + bt_shell_prompt_input(cfg->ep->path, + "BIG (auto/value):", + config_endpoint_iso_group, cfg); +} + +static void endpoint_is_reconfigure_cfg(const char *input, void *user_data) +{ + struct endpoint_config *cfg = user_data; + + if (!strcasecmp(input, "n") || !strcasecmp(input, "no")) { + cfg->ep->iso_stream = BT_ISO_QOS_STREAM_UNSET; + goto done; + } else { + bt_shell_printf("The BIS index is assigned in the order of " + "the configuration starting with 1\n"); + bt_shell_prompt_input(cfg->ep->path, + "BIS Index (value):", + endpoint_set_reconfigure_cfg, cfg); + return; + } + +done: + bt_shell_prompt_input(cfg->ep->path, + "BIG (auto/value):", + config_endpoint_iso_group, cfg); +} + static void endpoint_set_config_bcast(struct endpoint_config *cfg) { cfg->ep->bcode = g_new0(struct iovec, 1); @@ -3835,8 +3877,8 @@ static void endpoint_set_config_bcast(struct endpoint_config *cfg) } bt_shell_prompt_input(cfg->ep->path, - "BIG (auto/value):", - config_endpoint_iso_group, cfg); + "This is a BIS reconfiguration? (yes/no):", + endpoint_is_reconfigure_cfg, cfg); } static void cmd_config_endpoint(int argc, char *argv[]) From patchwork Fri Mar 8 16:52:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silviu Florian Barbulescu X-Patchwork-Id: 779224 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2087.outbound.protection.outlook.com [40.107.8.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB7B8568A for ; Fri, 8 Mar 2024 16:52:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.8.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709916764; cv=fail; b=Kj4cwfvCPMNKlNwV4MRlLY7x2vGZJpC7K6KDxdE7RBWBs00etgeYFaaRi09crgABQTEDkbspMTfxJlqoSONho4HJ2abdY4FyL3j00cMs24FkCzYLGGlX1T1hJXaeQkttmEU/ONrccUD3+aU09wCYOiB1RG80x5iFjHFHuZ+UsSo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709916764; c=relaxed/simple; bh=6H91+ell7QxG0iU0eeQr9ilKxRPMiYvwfka/xCcJQF4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=ICf769tsC86iZE/vh98eLQL7DAPPThSbcximSUvhEEoOlP9Zp1YKRUvVov4TsNaxbzKEpp2bKLVa+tfpSw7XdQGzorqWPp1IemsmWLVd+R3BD9BSJTX1gfbGdmysvYeVSDDHrdKwMfKd15xgnBl9F5w1NyOuBVKy+vVcZ40y7SM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=HWvXidBY; arc=fail smtp.client-ip=40.107.8.87 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="HWvXidBY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gGFXd7oVE5MUEDJUAZYu8Es18Bp56P1ZbcLrNRlWTqOLG7iETOxy2toqIWNUtZcz/RGrODTljoLD5tvlcEoUs6AuhI83GZW22NZyCOtFGbw9dlhjhX06386H2mdFILo2knWpIaU0hZftbOUTEhgTgYpS2L0AwEdTEEIOBfimJtzSkROGm0eqDxF4BJZQjOOK59K8BHYyvhtubhwiaJRXUFqA+Ls+dRXY7Lf5O4nL9XtcN0fFzVR93z+ddFrwq1DMNqB1ou9/7qO1mhYDJBjd5d/6vsGYuiQdcXWc6WGb94SoBKf4jh1ZvayDrLhP3OgOnr9yc09C65fyQTxrvp/Blw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YcCedravAhcWHXbfrjz/VpIr8z/dBR1tEBbH2gkNNa8=; b=bcIPUwZHxo40OeS184sVMWZe84av6NzVKpZI8m+JklYWofIeEctajJB2XrkfjB57M3Exy1xNyMGhOwhAerc1QEsJ/uC2KWs4gNPiNZs/GPvW+FWkI4M+MF4KeLEYIju3+BLMhB/WTOy7k+ygovB0X7ryWp3L4NPz6LkcoENjuxaqVB5h0iQQI3xYGFXEM9jGc5MScxIoJguobl/wC5gvfhMU6oJTCBqCiz5XilK/v4j/wbrJd034i69y8SEG0mzOkJ6PLosaSkv0qLV6QFBAgJYo2C72i6SlHqVtnEB0Xgl32l9oPTdOjEoM8boQbC2ZSmxXmeW1vN9JFB1hTi/tLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YcCedravAhcWHXbfrjz/VpIr8z/dBR1tEBbH2gkNNa8=; b=HWvXidBYyHo+vkrnfR0YikHTnV8/it1gDdDl3ZfvkkvFjuH0Uzh4Ouol+uxxAb+vRTpOgYt075STh2o0crYUc8SdMtUA+zMbxWfuAqBF2Ffhc+IQBKr2WCSozpojsBiQVG/P7utDLfpeA+nYmQLU6J0YMR5j39oswgsT7DWeh6I= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) by AM9PR04MB7572.eurprd04.prod.outlook.com (2603:10a6:20b:2d4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.27; Fri, 8 Mar 2024 16:52:40 +0000 Received: from VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::7bc8:c6eb:cb72:91cf]) by VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::7bc8:c6eb:cb72:91cf%5]) with mapi id 15.20.7362.019; Fri, 8 Mar 2024 16:52:40 +0000 From: Silviu Florian Barbulescu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, iulia.tanasescu@nxp.com Subject: [PATCH BlueZ 2/3] transport: Add support to update the transport configuration Date: Fri, 8 Mar 2024 18:52:31 +0200 Message-Id: <20240308165232.53906-3-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240308165232.53906-1-silviu.barbulescu@nxp.com> References: <20240308165232.53906-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AS4P189CA0036.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:5dd::7) To VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB10073:EE_|AM9PR04MB7572:EE_ X-MS-Office365-Filtering-Correlation-Id: 7447db6d-563e-404a-1a7f-08dc3f902a84 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CxPd+vsFu50o5lMeQ7zzMyWMfwtApsSPVzhYzEuCUgGFEGBitRZ597aRj6OASWeDmTBpoZx8VvckABWgY2CFtTCcq37gqTlm5cs6+OntLuWYnqt+/TZy8eLaQAwMPsVC/IQxPA0r2m3d3iRiuiIstR306xWkVPvA3l09sGs68zuxeK0XleiReguJgdtvcdOWoVXayPgBdqMMX5PeOa8idQ79nZhsSeU+mWLfotLP3ClfR3HwissZp85AliCkP9SLKpViiBqpbOLkIvmRnXd0/5MBPPSOsvE+SC6DpViYC7R4cR7SjRqag2lsXE1zQvXGPGKl+pdRMLSmNvAiMB3YT8fLIoysohnpQphCLr/tr064lMdmwAy2rIkhet0uGX3nBmNR7Se9aColkwEFCVIbckHCfZR3W2YuAEgkJLxoywIJ7bosT12/qVFO29y0dtLmhlo9op2JAvXo64SjWy6Beri6FeprBGfOV1JbtAJF5me0s7dri9nBa3Wq0aDyT3ImUaNGLhWUKsl+2UkRCOJJk3aHt8E5ViaDALVF2gZQpwP9ZIPaotwtUwdRZn2/rHlfOxvnJ2qpIn5w+kqB4XftwyBga5gNqnf1HPPto+013+DWJkBNN3/6b63XvzpVepVT6bGfxZJ4FTshtj8Dvs06rXi0SLNHgSFRT8dLp9tIrFY= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB10073.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(1800799015)(376005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4XujY1236kilvIei2CEZ7heEy7jsfGi6O4wXdt+IJRTmIB+cW8EiKnwGfNASNLaBNaCUxP8tuWhMRtoLEy+iA7fTZGukjslM3jtHluqfkkGaVDUByASdeXSwP05xJyWQtQRabmIlSvBjTwnQAoSiwOLIi/R1lgotkFaGaSJMG6IICE2ATMqZVc9WIP9UHlZE4UT6DXjwQbPX2ekIM8DMADkDkiMmneIZcibffoQai30lmnoJhfq9P86wfvgMQ4rvxayR5fpetg5iRX4c8udGV9r0E+otkIpygJwLHVH3WxXcIkTCoHzCbI5hlzqq6z1uu8CjhbAS0wKZiKlQZ5bgdfTvKKGH5Rrt5+Ubc3mOJvpTVIOoGbBhPA8zOw0vlwNcbvZNz9AnfDoIMLqjfkdjpvAL8931O89w7cyRW9DTSE3MykplH/v7fAZ7kQP8xvqTgdC5Y0HMF4CW/N2VTNiHq5nvJPqJppcGQvLCbbeTN7ExDn/8Q2SO8tDxFspFv/wcSVyX2Sitjj1/b8fCqLVL+lfMT0dNutZFNzK2tM+sS9S2gSA0FtGFQN+ddT+1mnqIkqQyU87z8HoUGGtZJeQ5iu8tv7rR3v3X4kWM8gzFR3vLHH7SJxzpokuOqPolg+9ScJ1vi/JNMGqgNtqYWoqBvbxi63znxSgPLytNbR3JCpj5I5Pxnrd6I/CctHAAgmQ4eEvAVgULtGiHM9dmqIJl55aYaADiLIwTtSkG8kRc0q292rbGjgrgVK9luLsLy6DQhz0g4IZdJ726WSV8np6BS/St7xsb/txsY6sENoVE4VBUuCRHiBu9IP4Js26IRkgwscUFIrYD394USpHdi/bWxLNZ8DUXBHg0uTJyC6+JhtjmBTPRpQAlzNqPKeycL+HoD+ti076KSfyU2p1gmAU0x4dGDhT3N8vtyZzdg6N4fG52ouxGj+vL0jt+P8MW3LfBTpZT1N6+4izB1QJ+UbGjDXezY18be0Ab+/Qyvr8DPHVi6TD00ojdUmaXZW2LGrJmCeLwRojGF86MmeN+KwUZu5a579t4AMdkUGXz4hVswy1stE+U+SaR4KviqfXHRMxQctM5/NznJ29dtPUyJX3Mb0zSz5cGuHPe3D07MuZShFmdpM4CtmteDYBU0BpJtTP3Fg4t5qA1cldfBmWysdGmf5hKm+pYlmt8r2ARdDHhKRCg//PWWreKF+BvHeEzehmwQYCbfkanrxhml8Ke/jCoT1UIv2noAana86fkxu9L9HActk8CaZnwOEZarQoVjKoxzksWIcnfJyDQoqQGSL6/Z2aNihvK9e0KCzElzNgOB0oEEseA0ds8P3jcaOJkN4EmHXrNtSXKf3xJueNjzws+L9LxHJOS4idaNRnj5mPvLYDMfMT9CnlBEXj7Ife60PXqiMyZ6jcPeHsDhcPxIL9SiZIEa+BPIdH9ca1QcxF4J5F5WtX+IXIj+FXhE+QI01/PxWDe/BXRJeNC3FBq6qdlCp5MczGEX/LJCdIUtB2DVl0nZ4b2wv+qlcwdjxcQOl1m3HR5/Dc3P++xO/2Ibu+uv3G10whHLc8QSLNPQTwnZ8JV4rUD8jkP0TYXQHmaPSwCqPV52uF3mOaucORVNXDlnw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7447db6d-563e-404a-1a7f-08dc3f902a84 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2024 16:52:40.1918 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jZ7USMPVrNNLwgi3s8c8EZSLncZq1+CmKYX/Fqw+M8A2rUSUXRC6Y/jt5fAWRu42n4Q7ulHjrJahhZ3Dj0pc+ZqUIddp04u4kCjKu3JQuzs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB7572 Add support to update the transport configuration --- profiles/audio/transport.c | 23 +++++++++++++++++++++++ profiles/audio/transport.h | 1 + 2 files changed, 24 insertions(+) diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c index 159fbd575..c8492d4a1 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -1483,6 +1483,29 @@ static void bap_update_bcast_qos(const struct media_transport *transport) "Configuration"); } +void bap_update_bcast_config(struct media_transport *transport) +{ + struct bap_transport *bap = transport->data; + struct iovec *cc; + + cc = bt_bap_stream_get_config(bap->stream); + + if (((int)cc->iov_len != transport->size) || + (memcmp(cc->iov_base, transport->configuration, + transport->size) != 0)) { + free(transport->configuration); + transport->configuration = util_memdup(cc->iov_base, + cc->iov_len); + transport->size = cc->iov_len; + + g_dbus_emit_property_changed(btd_get_dbus_connection(), + transport->path, MEDIA_TRANSPORT_INTERFACE, + "Configuration"); + } + + bap_update_bcast_qos(transport); +} + static guint transport_bap_resume(struct media_transport *transport, struct media_owner *owner) { diff --git a/profiles/audio/transport.h b/profiles/audio/transport.h index b46bc8025..6df419a67 100644 --- a/profiles/audio/transport.h +++ b/profiles/audio/transport.h @@ -16,6 +16,7 @@ struct media_transport *media_transport_create(struct btd_device *device, uint8_t *configuration, size_t size, void *data, void *stream); +void bap_update_bcast_config(struct media_transport *transport); void media_transport_destroy(struct media_transport *transport); const char *media_transport_get_path(struct media_transport *transport); From patchwork Fri Mar 8 16:52:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silviu Florian Barbulescu X-Patchwork-Id: 778920 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2087.outbound.protection.outlook.com [40.107.8.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 087791CD0A for ; Fri, 8 Mar 2024 16:52:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.8.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709916766; cv=fail; b=ARLDqYti6cdG7nL4vq4G35XgdEF0quNhnBapI67OR0hRv/b5TH9D+AHsVySscVhrYntm2BHM5/tzlED3QkDENCdss+Plr2Kk8Ipud0PoF2U1B8VVMqP8iQ4Hn1YBScWtEX6/s9NteWpMA3joVCfMpOBTA8SumKUMXlP5eswSfIs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709916766; c=relaxed/simple; bh=ddpS0CDXa5snMYVQNxtR3boIurEljaQkfSWLHDdRhP0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=EELGWGCiOXRmI43XWupe26Q3myTdcUiJfnd/nNehWIzv61ao5ln5NTrQqyzrRIJTue8n2mNuZy0Y8Jhcoivo3DzP4G92U/sOKMZiNtBRILNGgVg4ho5a2rox0CwxM8ii0UIIxIQpVbC6r5D04uKE52CeuIZsuw8kkAcFCzTrHLM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=hNjzws0O; arc=fail smtp.client-ip=40.107.8.87 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="hNjzws0O" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kuJiSgYB0eR8H6yHkRWacDiA3D2U00FXBweTJN++2axljoJSYFGo8kBXFgvaA1yPrW/V36b8vAYf6u1KXmGhYyl3vhfpWwHM/34W1QTZNYU+KCMg9gIzUTSV5VZtSIps4H0Fuw+l7wo3S4aTdOwXG+z753VxiIaWM/kq92ocR627y0K+94BILeAXGchjymuaUBCO30lZxRl+NOSDTvBYGeEijhXsXOF30RaLKQMkSpuXYWvxD0D8fiXBhLTUDaZ9r7oAldQEQNWuQ4zZy6o7MVKRJQ06An33aJZon+O8UKgy6NVx4rkMwSeDrWCCe5cuL/w/9TLzbKzntYQ8S4YY7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1HQ0ZMjXy/SkPauEQxTBZpdnlHWZBY6Heo4LSyxwYtU=; b=VYB79iDprZ3wKoANVm8llxQkjStpyxrCAGUZ8S+s0Vlo3JxeUdYQqtwGaxj7j+bj/juLEezDbQi/mpNeVpu6zw4tU5Qa2mbQTXoziW6+tWABe6jw2boHiPA1tA0VQKQYqlNTOl/j9guCwNhXAyrffYqL02MhQWYNLtFokew0npVEm9f1Z8zjR+Dpb/UIfACqN4G1zLHs8k3TOLvTEoOEJgrJf8U0qidQJ/juzJT6Ex4bcu+yEk0jKnXiUj/j6CP7Vzo//1k3T1J4tSyuhGSi3xYHlx/6mzyxZXs3HyOhN07v8sUlBcgzK5L7MlP4T87FqtL/q0Mq4JS75eh26/6alQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1HQ0ZMjXy/SkPauEQxTBZpdnlHWZBY6Heo4LSyxwYtU=; b=hNjzws0OK5Zps8Awy9PcpC71+eK5VeOoSy3P8ctH7A7Q0nNGkN3mJgEZqb0e+RyFU/ObXY9pQFPK5/ebPExvoenEHCNHCBTFX1nKU8jIk9ExUI/kPvYtIWZ6JHhbMmod+YjQZUXKyBPMpMkAprrDiiugk87W7g5Lcv//yiQtvmk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) by AM9PR04MB7572.eurprd04.prod.outlook.com (2603:10a6:20b:2d4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.27; Fri, 8 Mar 2024 16:52:42 +0000 Received: from VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::7bc8:c6eb:cb72:91cf]) by VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::7bc8:c6eb:cb72:91cf%5]) with mapi id 15.20.7362.019; Fri, 8 Mar 2024 16:52:42 +0000 From: Silviu Florian Barbulescu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, iulia.tanasescu@nxp.com Subject: [PATCH BlueZ 3/3] bap: Broadcast source reconfiguration support added Date: Fri, 8 Mar 2024 18:52:32 +0200 Message-Id: <20240308165232.53906-4-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240308165232.53906-1-silviu.barbulescu@nxp.com> References: <20240308165232.53906-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AM0PR06CA0099.eurprd06.prod.outlook.com (2603:10a6:208:fa::40) To VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB10073:EE_|AM9PR04MB7572:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c008717-7b16-4ccb-aab2-08dc3f902be3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9J/q0k9uynIguHmeZ7BSSjR2/94gzZ+PE1S/TNiY83ewL/kF4yIo1RJAJkYRvs3Z7OKGoyBtMGndAVpLgBmhmmFGEKct/6HOOoCrVuv51opnJdmX1fOhWG1swnFQ2l6zT7FXa9+o3SIzMqIRS0ynKYcGeX9hS39EgjyjGHoFL/HWCUAz4X+uSk2R0Vv6bi263loog0cSqrKXMaz92fl95/9+k357F+4NCt9pBpK+5i1175kldqB9z9H4J4NSeNti9GuuGvAGVo7wPNrLY+zs2jyjBx/a2NACR9y8Bgp3sQoYquqNySzpWyjYqX2HSid6lVpRd12KBrQ5NbQYZE2Xy2NAz9J2gVCVRrZ/FuIaiN6BeHh2kpr71fTwacwBFHGr6F/ZWWLNPVmFOY+Ssy+m6V9v5viWSCHOSfN6YZYB7mhtcp4oAZMvU3qkchLOTjnBdi3FR2Aq/xefhFH9eMMAZU+Ij2hYIDKtoVnG+Hx0qwW9v7whMGtEM99IgnU3whwOZsvWpArdw8oWWOJr27LMg/wZsCqy8/Pm0P3FxcKSYjWyY4amJJBj4XDAfcS7idAMdywJibR2Nq78zx1yc1fc8x2ZZ6FSQUF7qpIeC5hHgoJFlO/O29MFZxPldjAgW125QqK0hNkUv2KKfN/evPrFt463qqhBsd7mJ7KZhELCqlQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB10073.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(1800799015)(376005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9PHfpwPOdjh8A0zn2YnVxlp/tOMb/UJEtnL0Rcrsjr7DjOSgOjIugrAreWKO6PFMuR5hqciDdxBImicE9g5dTkRTYm1TUO/puQc/Ya+JkQkzeJEIgkB7dOedHKAM04I3EcSqfWJCw5rwcF2PzWUDnhUJ2ZlPuoVY36l8BaLpWTBozUuPKt5BVGP5k0+nnoLezD+ylQIvAM5Z62wdTwv1hQbHLdZitt/4N27sEdwgclT4BQilYn+UBMoN7B5E1MgRRufaDYmS5CRioztLpcf157yLFCSo03ACnGbXGD+VF28ODuOlq4H/n6newC9Ho41gYsFtPWUf+0306foiC25NfUBn/dJORIdSY0L3KiFPlnDIGKehDizw71xljm3c7aqqLpX+aD1nFgU2S9SYJir2lwOFPk4BLYNzoy23EUhi5gLjc+l/OjSoGtqcpSe/6bNx51hmVY7jioZ9+TCs8gdkC+Ad2aBMw1/4xevIagsQEZLwJA2s3xXBvWxkKaUciEDbf/x7q3/eTQeRgQ3JO1iGNer68Q/mXP7L4Jn4YYZYYRhhZ7zwuNWF43RKi4t6TVkPuf1AK6QRsBFKs1iF94aRc/ycEYYyfdQtQfv556TaEbAyspOF5Zm6Gp8APLut+yoY/LMZdBXU7nkZAlT2KswiGv5kGWUYZrn03xx53xUPO9oBN7IxDmoPQo7RYazYwO1s4oIcEj+0/vtSQnI1rfgwm0f423y4Hx/Gb+Mlqn5cl5ZBEqJkHGYUayJm+6g9f+8gHMG4amm4sYiD+cgYmsvUSdyoNOBG8Zx6RFSgw/rYHlWo37aqF7mrwGMO8aZWUnmO/LU/I6MR1FbmzUsCJsQIU7RBCpSr/MYpCKzwKv/7m40cvRYb8/gVXVO5wvHzjFYnfRe3mM90hmaClLzlIKGvYJrBCkqUaqjd1/CNtYOhrZ3tCU1s4reLtDHtbGME8TaQiFviDvM/AKcd0ylV1b/bgVP2SlbqlNmoI9f1STr/bAJ3eCfEdcCLllj4RPHJS+R7rIfbmfggblDli7Iq/Wm+AC5kpb3WDOzvEWzS1upkFZL3wR6qJtTxsU/tqU6efamjUPMT3UG97R4OVzwEE1EA6xVWxm4ZOsxoRnHIAs0yLSrc26A4GKN6fYVz/uGKg0OrSJ/VWjQt6IdkQuAy8eGlaZ8EUtEzL5JqTlleFJN9MwU0iouLt95a4CEntlno4W7pmkR4gnk66FgdNpx0WWuQrtBeE9OSgenjXbaQS56atVco13BhscWSdr5R6Arb9OT0v1GnexiofiwS8YhzM3LISVgk0CLn7fS7buQ+mlLI5fwJf7F9HzjllJVe91asn1KXxUjQ0wJRZ1es9EqnJaQ7p4k7C6C1EFx52e+CWYVS0OFQGXeyLBm3DYohRWEYxdjQKinvsIBlkbXqItpdYhV5WUHq8IuZZuO5sOTPQD7YmZu322D4avgtFkITXfL19zpOws2rliHDkMo88qlyD4/XreErnzCdndFGZh6QJqYqYeyfB6wVzmKCpID/xKoR4Xp419l6uonTVPufLgUMO+ibn5llycwK+XaJcWi7AN8ljBNXNSvU5SY42os50ucUWhzyWxSslVDr7MrbhepiMIqv5w== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8c008717-7b16-4ccb-aab2-08dc3f902be3 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2024 16:52:42.4993 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Br4EiSvbseTdnnu8jGkd6TnyOAfw9ullmC/mR3LqyRxNXd0q5d9WA0W1PWiLeZaDa5lyW/wE6wQAwbTVIcSTUhOtchDMu5/9oo7b2+zKXCI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB7572 --- profiles/audio/bap.c | 85 ++++++++++++++++++++++++++++++++++++++++++ profiles/audio/media.c | 3 +- src/shared/bap.c | 9 ++++- 3 files changed, 95 insertions(+), 2 deletions(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 1b8a47c52..c07506c45 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -580,6 +580,11 @@ static int setup_parse_bcast_qos(struct bap_setup *setup, const char *key, return -EINVAL; dbus_message_iter_get_basic(iter, &qos->bcast.big); + } else if (!strcasecmp(key, "BIS")) { + if (var != DBUS_TYPE_BYTE) + return -EINVAL; + + dbus_message_iter_get_basic(iter, &qos->bcast.bis); } else if (!strcasecmp(key, "Options")) { if (var != DBUS_TYPE_BYTE) return -EINVAL; @@ -881,6 +886,62 @@ static void setup_free(void *data) free(setup); } +static void iterate_setups(struct bap_setup *setup) +{ + const struct queue_entry *entry; + struct bap_setup *ent_setup; + uint8_t bis_cnt = 1; + + for (entry = queue_get_entries(setup->ep->setups); + entry; entry = entry->next) { + ent_setup = entry->data; + + if (setup->qos.bcast.big != ent_setup->qos.bcast.big) + continue; + + util_iov_free(setup->base, 1); + setup->base = NULL; + + if (setup->qos.bcast.bis == bis_cnt) { + util_iov_free(ent_setup->caps, 1); + ent_setup->caps = util_iov_dup(setup->caps, 1); + util_iov_free(ent_setup->metadata, 1); + ent_setup->metadata = util_iov_dup(setup->metadata, 1); + memcpy(&ent_setup->qos, &setup->qos, + sizeof(struct bt_bap_bcast_qos)); + ent_setup->qos.bcast.bcode = util_iov_dup( + setup->qos.bcast.bcode, 1); + + bt_bap_stream_config(ent_setup->stream, &setup->qos, + setup->caps, NULL, NULL); + bt_bap_stream_metadata(ent_setup->stream, + setup->metadata, NULL, NULL); + } + + bis_cnt++; + } +} + +static bool verify_state(struct bap_setup *setup) +{ + const struct queue_entry *entry; + struct bap_setup *ent_setup; + + for (entry = queue_get_entries(setup->ep->setups); + entry; entry = entry->next) { + ent_setup = entry->data; + + if (setup->qos.bcast.big != ent_setup->qos.bcast.big) + continue; + + if (bt_bap_stream_get_state(ent_setup->stream) == + BT_BAP_STREAM_STATE_STREAMING) + return false; + } + + return true; +} + static DBusMessage *set_configuration(DBusConnection *conn, DBusMessage *msg, void *data) { @@ -922,6 +983,30 @@ static DBusMessage *set_configuration(DBusConnection *conn, DBusMessage *msg, util_iov_free(setup->metadata, 1); setup->metadata = util_iov_dup( bt_bap_pac_get_metadata(ep->rpac), 1); + } else if (bt_bap_pac_get_type(ep->lpac) == BT_BAP_BCAST_SOURCE) { + if (setup->qos.bcast.bis != BT_ISO_QOS_BIS_UNSET) { + if ((setup->qos.bcast.bis > queue_length(ep->setups)) || + (setup->qos.bcast.bis == 0)) { + setup_free(setup); + return btd_error_invalid_args(msg); + } + + /* Verify that no BIS in the BIG is in streaming state + */ + if (!verify_state(setup)) { + setup_free(setup); + return btd_error_not_permitted(msg, + "Broadcast Audio Stream state is invalid"); + } + + /* Find and updated the BIS specified in + * set_configuration command + */ + iterate_setups(setup); + + setup_free(setup); + return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); + } } setup->stream = bt_bap_stream_new(ep->data->bap, ep->lpac, ep->rpac, diff --git a/profiles/audio/media.c b/profiles/audio/media.c index edaff7867..084c09fc7 100644 --- a/profiles/audio/media.c +++ b/profiles/audio/media.c @@ -1154,7 +1154,8 @@ static int pac_config(struct bt_bap_stream *stream, struct iovec *cfg, endpoint->transports = g_slist_append(endpoint->transports, transport); - } + } else if (bt_bap_stream_get_dir(stream) == BT_BAP_BCAST_SINK) + bap_update_bcast_config(transport); msg = dbus_message_new_method_call(endpoint->sender, endpoint->path, MEDIA_ENDPOINT_INTERFACE, diff --git a/src/shared/bap.c b/src/shared/bap.c index 37fc1de4e..07f5671e4 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -1701,7 +1701,14 @@ static unsigned int bap_bcast_config(struct bt_bap_stream *stream, struct bt_bap_qos *qos, struct iovec *data, bt_bap_stream_func_t func, void *user_data) { - stream->qos = *qos; + if (qos) + stream->qos = *qos; + + if (data) { + util_iov_free(stream->cc, 1); + stream->cc = util_iov_dup(data, 1); + } + stream->lpac->ops->config(stream, stream->cc, &stream->qos, ep_config_cb, stream->lpac->user_data);