From patchwork Wed Mar 13 17:02:58 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: 13591621 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2071.outbound.protection.outlook.com [40.107.6.71]) (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 522EA196186 for ; Wed, 13 Mar 2024 17:03:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.71 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710349391; cv=fail; b=hp6aZc/lFUOzRaueyUG+NMbC3MhQd+DHEN0HmQCJN4qMIqWahBFK0k9wAQX40xE9AfZalMcKW8SVHkgeUC82vMPtp68KCLgM9vPOG2M1L2VUIk8NwG4vQKJYFQp9MV8gs/REQ+j0eHEg6zjJRI8Y73vsOqAT16o0ELfhW97rpTg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710349391; c=relaxed/simple; bh=CAgBBnmXPEzJEuI8p3aCGv1yElbjI9xtc0yMh3Dveho=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=dksSUW8PhsY2aJBhgjHwX7tRjv5KdiFyMbDyed9C+3In4yPYh9VTXQdM8z0wprz9xDQ26eepWUjTquT63h70iaBiWE4xbwgt8tkqZL0Bk5mR7iz29OymIdtd3nF8GKmOA/WTYWfI3P1ZOonH+GIlyOLemLtqbuflF9frEZIlKvw= 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=HQy0wHiq; arc=fail smtp.client-ip=40.107.6.71 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="HQy0wHiq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GjooD5nLdJEk8vWAtr3VAL8swfIqdzXLiI8paHwDcD7APQJVCCCYJduh02JOFio0qpWju0mmnvhhKVV1TIlbTw1+Sg2ZVxkmePwIvotRS+pozTGyD/ORet5MMwxGKoizDTnQqaaJ6s/EWdGmOnvP/90X16hw5hd7f4vuqFfBBnjA647kbr2BQN85WUMw1HdBGqOAUtmEhJPCGeeM8X+YdwvujTnQqYNfUhV1zeX8+mcqS27qjx8YfBZnOtYM0ElNGDnMRTyFSZdkGgLhmIOk4s68cWvwomx4rHPcjAU3aRKtK5Ak1PepCaC+v3Or4t26s0fbCuxhddQ333SD+bBLsA== 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=AAuRi3p/BbhKn0Luyg68a4MHTKM8XOkZYy1hlQg2JNs=; b=k6L9Ht5pnJbGdRZmMLl4Yn+1NU7GxCF2elAERH+5or3qeEVR5FV/erDF9fY7dKQ8AnrDmrja2/x+eUc+gOOlz+99om+ak8C1wmY/DqxC5uA0oRvYRjB7GOut1Yx/9hdSjGgXjcevb01w4Bnt6QbCycjBLbbITZHs8rbl1QrBL6zt9R8jhuXOCbrD/Xt7a/E/KoCgeVgAMlgHltxuHGhKpi1rXdONIu+FmpIidwNjfuKkuJ7XH5h5SFyzbwdVB57+1+Xd+I7DE+XHemOdDF0JoCbcMcX8QTA2b5dQQE7/ucZxBu86/86I0dJLMt2VgtrszMGfvDI80a3RsDuF4XuDAw== 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=AAuRi3p/BbhKn0Luyg68a4MHTKM8XOkZYy1hlQg2JNs=; b=HQy0wHiqQatgtS3RCs3YnyA4avFHFa39fKJdbLABoFHr9u4gxp2c9fYpc/ywB/Cz7ZCOj8HlbH5rex+KzUoLPaoTglH/o+11DaSWrox8dPRUy0ATbxzNlLRp7+E1KM3HiXO1iD+OPc33sckAIy+gHvmPJAqWtVvsXDEI3+OAI4g= 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 PA4PR04MB7517.eurprd04.prod.outlook.com (2603:10a6:102:e0::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.35; Wed, 13 Mar 2024 17:03:07 +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.035; Wed, 13 Mar 2024 17:03:06 +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 v2 1/3] player: Add reconfiguration prompt for broadcast source Date: Wed, 13 Mar 2024 19:02:58 +0200 Message-Id: <20240313170300.40974-2-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240313170300.40974-1-silviu.barbulescu@nxp.com> References: <20240313170300.40974-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AS4P190CA0018.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5d0::11) 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_|PA4PR04MB7517:EE_ X-MS-Office365-Filtering-Correlation-Id: e86cc4c7-a5da-4c46-4c8e-08dc437f7411 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zeWgi+uJwnqDeWY8JexL9RRP/oxT3xBcIakVdHvLWITEFPeluUxkNDuOJuqC+89mpuJuqEU3OAdC5l4OM2KYj5JbkIY/Sp1omjzDNBnhX9BCW6wCx+JkS6P1L7NZbze7QlzlSRbF8Wx0p+f2znBTVLpB+bBcKyMHeVKuKeaiOUiSZyCscpjna6w0t4RZh719QRFN+1pa6L4PHnvERDdXXSEVsfDP3v/3PDPpBW4zTm/LjjrXr57pMyQ0/NvqVY0ihoal7RB1aXDMOtfQudf9gZy5AFWI6qv1kY2D4dkP86iJUHOgz5vzH6q6pU47lau+PWWEcGsDYq7tT38qBPtWohHjOPzW2B3Hi/sNl/SjjluMBnwZlKfF2V+248RHjRKBXpm5cbd128ABh1PKqjlSd+4onsQGr+qviMC3J7KZghr3ANM1N/k06OJIeAjlvER6Zo1DvozupIWIbNmgHFutg2tNKHwM7GZNHZmnlbGSdebw3NITuxkoA5BgFURCgmuq90jk5QKALkVJoWcHqblp+KBJnr0IF0efnHGTztGb9zEkJ/DpljPpMdsNKGl01NjPuxeMJ76woZ1yIpKSU4wpuGUnZbrBiMLLHcwDADsoHmEW3d7fydRMVQXkdRMjExRLmWOSFakZ+eB9W95ZNgqSwjwRUDBVajEcgMEAiyWlzsU= 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)(376005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: aBBX4amjDclug5Tuoew+Iifz2tqgafEJjta96ipAHTbj+H1WjsI90KPpy5GdP0S0tFCRPWccISsVTBnrK8+DY/FOZ/YM2qrxEAgYQXtR02q5Q3o74t4IuS+rlZNJS1O5BP6O6EwoDyaz9rZ+AohZMNMaCna81zfD4Ly0/ECTwFsA5mKpUG/u1rg5AlWLPSqFLZB+IgGqzggrjYvJrkFpyLRw+VNyOs8r5vNLfxrF3ZtUhgLuCdWKj4LeEKow5hPhi8NgBV6mRGWJR1X1ECxoqOEmmFIZZYHsC2ois18pV3rxz4P917VviqJJH6YssygXicECi235uD08mm1ZkNA3xLndw912SYJkHIv3gIGiSDimVn0RoyRpTHfxwefMWrIpZ6IuHYnigoF9xi1BKardSRZjS0D6s7r/aS8jEg1qMnM19/ExhueMvBl5GriwSTW8gGrkcvKxg871HVvyTX8v3UKOh8a9fibm00UUtt9i7uNJGjd8vaQaZaNM94CC/0uXqmsomzGtzdGBI04slo+Jj4m/lrJBD1B2GuknT91GdtQKCceriyGvx6en+5ni3nPI0u0xOw4SPPtnzfaCIWtaqW+MVDzZMXzqKK34jR0zSusBLrBDoUwdbcClKPhBABi9FXAMTfZIwXIDR5M+Oa5pzc/fvw1BxaOtohBRrhUi2PcqQxelzwJP1UQ8TZczCkws8ptCnjzCHsv4uAhX89SdptTjRNKxySVNpd6js0G+Azl1I2jVQ8XVKPPMORFz2+Y+AVG1evqI2rCn5CAYdXUT0BzsV9cvr6d4wQwb+2irXrD/AGFdus5sylVgCod27i/04SLmZns72GHrBntQSP1F75VA7URzJFA6/S04/tCtwlHl+Bk+N2tNpSKj4FIlXcXfjhXilB70rIAoxAt0eaW8dhsMKQo32EupS/70vJFoVd6+r5MBKydOBHWfLDR0gP/8hcGM5PIno61MdTcqo34zGnmAnzN4p64SJdO8B9K5CwJUfxSftrsv+v8w91Q1dZ5xg+GaeJOGtks7NQkoMQnrCU3YNi6SEIY8rjViOdOxpeCzIP6sJvxAoVVMjHD+mO6Agp0oTHUS7SpsVok3gOEE739/HHT0wP6ZkrtDGlwMkiHbLJzYJF/T5aLGjjIPkZyBSO5cVXnXjb9K27/0Mr91vYNlOFCSxJjN7qI4OtpG4SJ0Q3Lzhl2wqEsTZasO3ad2PP07m5EdQHii4vLZmFpX5WQnQUnVDqi5aj/U9RDZ5tO64g7dWnu81ZxXiEgg0vsTDRZDTi8ORBkzq2dfccS1sFORginSpf7C4jD30n5ty82Z5MRYeruk6UBCCfcd2OjcN5PEZZeHOGA+sDt4hgX+lHmD6f8C0a1ivD4uXkfa0uJvkSF2H0Q1vMeR3NfMJX+Pu63WYKxmfNVz19CrN0cx6Hf+ChP+rPzW/lf0smVW++Hah+jGmD7gtgIgZU0XM5CJsmun4IBwt27Ch/vAJOtcjtBoZvtZ66IdrJgXK5BIfOxE5aSHWcgZEGs6GrPhSf2rkaMX/ECDhsaI679o9wJBNklEu++nkPPYDnL16qwf7aWnPdLEzwDglFE3cF1vLzeDyaffPBRfp1WZjTypq/4fFA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e86cc4c7-a5da-4c46-4c8e-08dc437f7411 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2024 17:03:06.8750 (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: zkLbHC4numTsGnVDCIPaYM3ryYAyQVYR8uOHHoBSNGx/LwBeuyJVWFzkD8rtNUYYJEZX4hpnmcf4flaiAD1UFFqfjxkLMPGVt4S8hMHAtww= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7517 endpoint.config /org/bluez/hci0/pac_bcast0 /local/endpoint/ep0 48_4_1 [/local/endpoint/ep0] BIS Index for reconfiguration? (value(1-31)/no): n [/local/endpoint/ep0] BIG (auto/value): 0 [/local/endpoint/ep0] Enter channel location (value/no): 1 [/local/endpoint/ep0] Enter Metadata (value/no): n --- client/player.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/client/player.c b/client/player.c index a40bf66e3..688ad02ab 100644 --- a/client/player.c +++ b/client/player.c @@ -3809,6 +3809,35 @@ static void config_endpoint_iso_group(const char *input, void *user_data) } } +static void endpoint_is_reconfigure_cfg(const char *input, void *user_data) +{ + struct endpoint_config *cfg = user_data; + int value; + char *endptr = NULL; + + if (!strcasecmp(input, "n") || !strcasecmp(input, "no")) { + cfg->ep->iso_stream = BT_ISO_QOS_STREAM_UNSET; + goto done; + } else { + 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); + } + + if (value == 0x0) + cfg->ep->iso_stream = BT_ISO_QOS_STREAM_UNSET; + else + cfg->ep->iso_stream = value; + } + +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 +3864,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); + "BIS Index for reconfiguration? (value(1-31)/no):", + endpoint_is_reconfigure_cfg, cfg); } static void cmd_config_endpoint(int argc, char *argv[]) From patchwork Wed Mar 13 17:02:59 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: 13591622 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2071.outbound.protection.outlook.com [40.107.6.71]) (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 BC59F196BA7 for ; Wed, 13 Mar 2024 17:03:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.71 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710349393; cv=fail; b=DnVZlZhOJjxCWlvNA1aPaRwJMy5qwqNLCFNnU+Q92i6CkrT+JYrea05fI2PVLC86lQL4Ie8252jy/16rWvvoFR67I9cZdnz6w87YrEJqZyIhfqib4ELndT5VvovEkNrme/DFw8nnajcNpHHN2oPZNg9Tkb0HfJXzqON48CVs3C4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710349393; c=relaxed/simple; bh=0dRFxR0jNHmTqolxKejhwi7qMMg123Zb7P9CbwTAVrY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=otnLJMY/lmclDrkorGtMe4f3/GfgTaQPtQRfvN2DazE4Tctd9hr93Ale1jBh8XoZM1idl+x6AK+8Y1KecEEzqsiin7ztRbrrIkIDNW76sQRFaA96vA6o+bXqEN2AxN/vG/EBbqOvhSsPr1QILSg+q30mtT5G4OlqbPTRX9Dz9/o= 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=ERhKt4Pq; arc=fail smtp.client-ip=40.107.6.71 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="ERhKt4Pq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mf6rG6EMuu54/Sim/NL9VhJk/8xLOqBzU4dzPY14JI+RKyehUcFOIJaAwWJeCnUNWe3TTZ6vYn5ICpMT9tz2ZCLxcIdeDWkkLhdX0X0VRO6+EgqFLHxK/bMz0raiwcfDAKEo9PZBvnDmyfsXihtiFl6tahCeCGCbHkUW9ZynlLkIXJRwdf40dBR6VwmOs0CeRCdUm/RxuYtq8LOwwWy8jp8dnymQz0psyOZnxOE/72Ms+D8STf+C0t4ZClHVP5zjGHEHE0/U2dZH8xya2xO13Gu5eNd6z0raSj+6oSrY7oHHvw+8TQPs2CIE7+zV9zXSg8dc6/hXqYS7Z1JpK87idw== 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=6UYUph4A2tuOEUiY5ABfQI102bIvYPhwc10RJ5GtO5Q=; b=M4c2tkBRCQloGS8Yzv0Ca+hHKutNWLFtp7e2s5WVWwpozOceu/XZ3W0pWSgrp3Et/wW937Zj2l0BWXVpxG3iHo0ry1v0KUIOk7WadUYwY2KFOtADWEh4whDI/1+bMcuEbrAxffeAogoz9E7aXKzUqFFXMbau9ms47hFd03QcouGf7l5lh2T2LcQNMxsBZ0EbrE7Q4HWsvJuQljmI/uUNp92B5rgxtM4ZwT4pktTJw/13n7ZRn+6psAEqn1UtEQsbTAyq5xQoU5M4c1Iea45t896Oe/NfKiLg8TElS1ISf+PL/SGHDWU5ny79fJgkpF+lWr2JUp6PAV4qLFOotKUEDw== 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=6UYUph4A2tuOEUiY5ABfQI102bIvYPhwc10RJ5GtO5Q=; b=ERhKt4PqlUkhc2UTIImZzMI6Aepu+drvd00Dwqxli8y/k+w25jhkF8NpUt/fGuVmXW9WWD3NI1DI6/ReBWjf/MXkRBI2Ih9fr1833lQwQ+iiZbdQtC77vcoXXbMlANT/hnNuFdxBGhwvcRhbdYEJFejzrGnSJ3I9S8q7MPuwC6I= 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 PA4PR04MB7517.eurprd04.prod.outlook.com (2603:10a6:102:e0::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.35; Wed, 13 Mar 2024 17:03:09 +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.035; Wed, 13 Mar 2024 17:03:09 +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 v2 2/3] transport: Add support to update the transport config Date: Wed, 13 Mar 2024 19:02:59 +0200 Message-Id: <20240313170300.40974-3-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240313170300.40974-1-silviu.barbulescu@nxp.com> References: <20240313170300.40974-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AM0PR01CA0138.eurprd01.prod.exchangelabs.com (2603:10a6:208:168::43) 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_|PA4PR04MB7517:EE_ X-MS-Office365-Filtering-Correlation-Id: ab073a99-0525-48c5-29a4-08dc437f757f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1yqgt6ysbhjMfPEtT3v98Y0wtEFY2sIrLfIfbJ5nYBl4mmRiQA93EKFWkgIircrbvUBL9fbqQpeTiY0/ep9f0z3GIj5tyMCT5YO/Yk5pZa7nvEGUvxikdcxjLKUKq1BWyNgTqZYHuePvxHgh+/WsT5eZV1CZlzJrajoRWWI0uUrY26l2oFwvqd8VDUGGXWuixB9ONY6H254lI2yYIqh0elyFajoYOtfiltnJTiLbpaV1UnDDJgRG11L+pJKtwsUZFCIEKCQzttC5pZnFGbcv1Y7Y6HPFZio80vT5JxPHEWqVnPpUuMoCvYoXLwRsXufdyXf9IMeAJhhfmkVIwO/GDlLKWsBOzjh5eVpVPxKtzPOA5ZDs75/UCs4JLCmltw2nz3xiMPy3LyKcyyX27a5B3Z7XzYY3KYU+M6ILDqf14otjKtleBhhMkslMdOK4/J9UZkEVNgTiAsn1ROGAgg8UuyZS1wQ54rqs8myfZk2RiZcQeqEhY8r74biGzJDe9MxaO2gw/BNc0bX2TDUUkrMBBXHfytZJGzlsVfiwBLjI1PuSYEiGPXzmRF3ZrTgHZ3O2PYuqxYteyawZz9+3VM0SxYqRVivVeH8M0zbccuegQtnl/mxdIorZxxvuRy3rxGvGXCOavUI+7d585tBuLzfOhvUutqaARaxWul6VwKnG3/4= 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)(376005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: l6gODajkOaOVc53v90MPtnCnyyJHp+oozjNDz7MEKpsxVtB6fWSEfHbEKV7CnlkwfHpasQQFuApuZtmtyJQRYcSj6cKLCjGpaRYwR45ia+GrAg2vgA5/Wc7aKcZb4FCZmMd4mZBs4TgsFQ2ENujbUv/+w4w05VpVe7B3fHSKPhd5EhcfZPFvxJ/c0CV0gkzV2LB/GaetNCrvTFswWpmFubromrCrA0KW8nnQfB96NUrOSirI3opoJz7IYGy5+CTeAmqZSWnid3lbcie8IGB+tABhkETGcrGw1NOxVp43EvWTM7MQuzeumLx69VMh6LdtUK4D/jbK0WyNTgmaJA8MOcpLDbPI56SIfTIbSRndwm6Hp7EDGHKaaqGGECV1aLthnrbhLiEXFl30s3R5V91n2ISMxeDVXy3dvOXfQ/WzvoSN5E98T8EuhVPtwtGZIr+f6yyyqPIdugGuKx3jNcA2PyTHQhRGe8TYZCmUhdk1R3co1hA+/RH24aq5X1yikknjALtO6mqXt8NpuvoOolrpJ3UYFR1eTlhkzz3RCCI9y19ql7ksUpZfdhqRpL/r8CWFQtXlqOGKAV216vkj9qkYhV3habHGfhj3tbhvlb1BjkDkPjbfAISAL0czvS/gKIj9Cvr5QRmbqWkyoURnnmET0qDuhR4rloMa3lWxj2O1napujwEqK0+C6CboWj5c1KBhK7zXlaoPx0ybFjb9DpQgy9xQ2B1SDxoxCtgIJTgQi/ULMxrq9QNvIYaVt9bInSwjFoFSlWe9o7bLjbJbP/a1iODJxtu8EVVmgvlV/ngMVtKsTbN3N8FLp/7kJSS0q/NrlUcOiNXSFmBCG/1KAdWIpaR5yi/I1ZW2mTv3ozdJV3A4JDhMW/lA14CFyRZTcODpBInRo557uTJVtStehif6Tv+wSyaRZB+eZ1mxiCSiWcQDn60pPkGybEXEpX/XSRoRKTPGm44WL+UjkEDaVKUhWVhWrQ7Ph8debYGFl/vhrshfbSF4sG/bZXLt0VJRcDGvDMNboPyJhGw7ul7dNpKXRH2rAZn2OsZf72dnKqFlmt5uRVWGjDbDr9LnIxu28Rl11QYWktwWznh6/gy5+IpX0vzRLskplpI7G6aSHl99gHnL8YQdBnbiMGD0mUChmrGjhUZtdZHWr2GAputbPtuNh7D6iyUuTVcP0fXs63foA4HaLGPezOoZMJO7XlRRW32QYVGAmqA5VNXhW3cFLntDJAacvUpsE+t5U9zHxUy+NBuQa8KvIqgwVUfb8lZ0FaWGKPrmfbhD7UY30Xkbq6LDsS4duOmw31yPv97GxtijqldHP6wzQHrtCZjwE2bjoNLwDM8N2rbZbGwY9Eqly6gwxTaiWcn/N8x0ws5/l4lqibbjTN/jkAAyDY+QtNdHTGTXJDo8TrrmKw1PdMryub7vYAfBsWdqOkKtKNmDKGJKy6xtC4EfsaLThpt3oy5bRJQPTdRi9WRo/QAyTLngc4BAXdv20pxFlsmOz6pHEaBma6RpHkUPF+wCBrWlzPsC1hKqVcYsB6+bQIjy8E71mNZBZK/rPAqeA7pgf8X6HH2DOD4MDtKjVQeGdmjUnyQD9kieWzZhUl9YUpUoVu1ArxioVQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ab073a99-0525-48c5-29a4-08dc437f757f X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2024 17:03:09.2124 (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: GEsQcgoXRSF040mwpn7Ad7L+f0fQxJSvrcqVPFw8Ei1dM9TVIL4as1TifC133Nk6+p+TpXFAhuodD8mMlzX/jbG1k5tS45v44uDQZcdJfTY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7517 Add support to update the transport configuration --- profiles/audio/transport.c | 21 +++++++++++++++++++++ profiles/audio/transport.h | 1 + 2 files changed, 22 insertions(+) diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c index 159fbd575..122c3339e 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -1483,6 +1483,27 @@ 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"); + } +} + 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 Wed Mar 13 17:03:00 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: 13591623 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2071.outbound.protection.outlook.com [40.107.6.71]) (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 1AC70150422 for ; Wed, 13 Mar 2024 17:03:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.71 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710349396; cv=fail; b=jyzbm85khKXxp38pLQZ/oAgqpmWw5qh6bHa1A7fncwtqXuXb9Vd3JCO1nAQay27Tw+gaoqgLglyQ4KOH7CQsBUwaQknkKKaZiT0FlmeSse4wnJuAuSMdFpmxbBZhUk6WGltN5tbjx0aiiw7P/qWXE44Klq54B7jZ7XKHbxxzNQo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710349396; c=relaxed/simple; bh=Xr5zMGxrfWDhMwJO2dseuZp5Qgp3JzCB67J1E165uIU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=XZDGrqozfjO+gG+YBvZ1uxeV1hMRHsjwZLmfa6gj47yj83AHN2hZ5+lYxo84b4NOHc43Zvl1kvgqFNWnvrdKWDplXU89bpnNydcxkX+a+G/5CZcSWJC3VyBGxqXbXzsaHsR2AsN/ZkjuhbYh2mgBX0jXtRApENKSwszjdMk8k3s= 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=XDcX+P3w; arc=fail smtp.client-ip=40.107.6.71 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="XDcX+P3w" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jA2nzS2scpN7R/aE91GapR35yi9PYBpOOB8nbwjGvNZXt7EGaOUlQIdrRbMhXFlE0WEuf38iHCJn/x8d3sv3lrokBVkeOJTTBEJvwtk0FhJcBCNbdvOf8++5DWGwzzCIUKa22Lw9sLMJDT7lqm/KQD4oDLjTxbncMaMsJ87oonF75PBomcThkqIx6BDRg3dwh559AKhKLEV8R0RVf8sXBrPbCClM6oMR9BiXL3zyPf9pTC4MnLhw0OCycbm4qsuYLgQngAMVLCRKDwzyaio1dXBb98Ay2EcSRYzyrL6OKQRWq5vyvjEzK2SydyBfwgQoLB5bMQF3LqopweGvDoui0Q== 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=xpfH9HIOXAIKxkd4aJqBTl2Q4rvpz+zsFkQqtr9x0NM=; b=bqCoooAntzOINqZ101spDSC6YE19ksXc/TP3rj2gBw/yOmB1LAbm3xaKBe0jIZe3m/CMC45DWP4QBXrZPtoh5P5cCGFnD1QBgroFrN1/EQvAst0116ZNIn2rlu8C+3hK100EaECLOljt1L5yLD8cXoIOCuel2qqauj/k+ofI1QdWimcYmXu+FjsQoA2Dos78jMoNca71B0Jyvx+VLtIIiya+/f29/fH+miH55bUNa1wNYS0yARhuuv0LahHv1LFDXNTadZsRFtk2CDZcv6NlcYtlYm9ddv0Oxpemu7FHgOEEidUWKPkVZjaR0Zlaj7N+n8/szRpbJJe97iDNEX3i/Q== 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=xpfH9HIOXAIKxkd4aJqBTl2Q4rvpz+zsFkQqtr9x0NM=; b=XDcX+P3wFJ0OepqZcZtOdcfaPs25+rzCLGOLeRunIA2c98NUgwecSqlOPtJAHKbPTLG0OdVRYDTVJuGTLeSftyanqc2wZX3IJJdanhfCj6GTK+B/wAOTqidBBjC/grG89w9VESD7fszVRO6w/el56arNNM7rqy/xCh7f3yzhnPw= 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 PA4PR04MB7517.eurprd04.prod.outlook.com (2603:10a6:102:e0::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.35; Wed, 13 Mar 2024 17:03:11 +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.035; Wed, 13 Mar 2024 17:03:11 +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 v2 3/3] bap: Broadcast source reconfiguration support added Date: Wed, 13 Mar 2024 19:03:00 +0200 Message-Id: <20240313170300.40974-4-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240313170300.40974-1-silviu.barbulescu@nxp.com> References: <20240313170300.40974-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AM4PR05CA0001.eurprd05.prod.outlook.com (2603:10a6:205::14) 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_|PA4PR04MB7517:EE_ X-MS-Office365-Filtering-Correlation-Id: 3499c1f8-dde1-45b9-12f7-08dc437f76c8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3GTo+NVX2/p805jLPzXYSMChVE0AkcOlbGlNcPOHQ/Xd7HIVrvTCG23/WIsyQMiW8+WK7TPJI74lN03TSyrtslM5AvEiCENovVNGj9PXWeqcRd3dIifrD43lwjlPUehscUGoLbVVIidLCysQ3AR2J9Acmbdxiga7H6FQMtgPfuncNQR4TcsK0GC5rjWFA2YnMKqnYqNrjTaDnG0641LjlWhQABV3N//XP7eV5h/eYT0sIswsGDaL/3TdMTR7QfCxPSB3XUCTT1IGvywTRgl01iwMVLjQpUBNqDTrbGhHUj6pkvW8BXPbkj8ji3oC8sNLfk6sJhvEvJww62H+AEXJq9wkOuinHlGUQwgq30QpMkif0ORO0i6BrMOQ+eU0F7EJ47HcX2o4vxysNqaY69DZsYpImXEDKZQnPHmwiiYEckWYPqsttc82c+lv/lAn9tt9eHP2D69CCwGIGiOn0RrCw6maQzd2xuBaPjjX2Al+kbSyZvATJO46mSGiVgIO5D/ixlMZWL1NpWpcOTWMMsa2d/iX34inymcEPrF4VszurNI0gX5BWajOLbNKnaP+EMkXxamkrKRiRqEd6G8ArHYc/6CoEL6KLsKKbnIfywIBgiGGs6RU0RYasXb+5av11yCLQyEa1yqeijirqcLlQvX/VyznzOiNd1t21nUbmG/TKqk= 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)(376005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fF9Tr5UkjastGpFH+1dqt53oNk4snW9xerBh2jk9Nn7M2oc64CZypQgt+p+N8OoGxggaIFA78g4cFLlxtwIN168u+y+GWpNDt1PUkTHufDXi31iMiBaIJ0QwakbMNz886wcYokmd34i6aj9DR75brPl/irnr4clCE/YDuflSzzTyoo/WD5UV/a9c5eYVGFsc2h4uKbwI0hprSFw3lKqiGU+hRcHZRZdYnRrUhti1acP4acPL73waQKJRfoFAPvui2/L1XqM9QACirpwFfEgvJcWaDeR8gQYZMarv0wmAv1yAuquGGrk/9dD5hPzzrBr1tDTNuBBMEWdtovTZAe5Afy5v6BKaCG8UObgCwZ4BYPhiQu+YgoCm4tWimwtkQ4G2Bf/6Sg9pbXmz2VFCl3dgLrAaTBLUadxSY4FBabxPUrKdcbU3B1MuJ3Fnu7SHjWR38jA3RcikNsMSbF4iC3iI2gy4DLGIe9otKgLWaV+E2FgitlSLBhIRJU/teQ6+MHgXu1e+oC8H6zTdPZGA2OaTQGcAZ2kgCPjy8mZVGk+ChgmZt4lUag9mxAcHW5dQ/6MksZFNCTMbL3vVTptF+Hw1istqWbaLwk9p6EyxATY/lSHYdHeLo0gv0DAO3UZCUIFtO7XIcFAL/bvSzsJio/0xim4ZEVYHrjs6BSH51V8Veu9Ur8fP+IjiKW2SU6kjS6DghJpVbRaMPKbZdxT9+HtjVyEEyzeBwcfipFfAWJLVdY4Oyzc66hXdSW2lDJDaJBLRECHuqtC7hWv9Bt55Um9xOl0qI9Uq1H7B4O2Q7JtCBMf/uJkvKuE3XpYmI2ZTIy6imkP7VoUDze/DB5soyMoge139waLQ4cWMrDaq6bNLmiUs1bnygCFsuCB2RKMHX0wabbZUFHEWvAeCz6Suz+wDWgH43z3sCMfzGfYzU+LOTdjiL/qgBgF3vBaxbFvb6E0DnhwrZL5IcSDWiXvPVeJKZgAa0Y2RxxyDWVDSJ88luRx6GA4LwHmTWopajm7+NdzbMN/E3oWG8Xk/P56/UjAZCv+XYc4xByxb1/qxCNvAwnVBXxe7tX9uS10WO/WE9yaCLVpB2R2Gi7Wmt8tLfRWVcDsV6yqTqU1qPsL/hxEZt4jLD7GjZCgs/CD3uB9FkvzSZIESoIgAU7Gi2vq6PBV5Qc9RQShKu5W7Uly8k5uVhLf2yt7LpmaANBHPIsdASUcI3JUMSkv9y01uyk/C3t5rHN3c4S0n85Aa2gZLWUC/QCv9s/DHwS993a8Kn41vAiwG1t90KJuNNnA4VVU+F2G4yYIMnB1HAqgPITFJbqshPLurKSdEB4j9KQ9yGGc94phTHrvMWjwEnQFVT3ZeA5cc2585z/s98P2fNIz4nEfB/zd2fhAG96lkKC7yyiTlf6K7Eo+8Cu+g5LZSnkBjITHlstwmpQTkM5mdETsiUDvYQaL0BuvxggXH3xYGBxUR9HhwdVXnRRYvLpoqrU3wwK/PzlmOzeXmHsEh0TLWCiHGetot8OnVN7CNpLKWOZJdXuleXKhK9HowJnviSJJtFER9VHKaWEy4Fr2kV82iwBlP+Q7OUuDsL4oZKHesSuEd8brZj/sEk7u02K54Uqy+QS5HTA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3499c1f8-dde1-45b9-12f7-08dc437f76c8 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2024 17:03:11.3614 (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: J2OZjc905cpqqgd+t7GZODsc7J/7b6RSTVj8365vS4M8gXD3+BhLB4Q7OkdWs6XzpBI6QOv/Mjy3pn90jv4GOa4J8WQhgJ4jTSL9DBbGUI8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7517 Broadcast source reconfiguration BIS support added --- profiles/audio/bap.c | 76 ++++++++++++++++++++++++++++++++++++++ profiles/audio/transport.c | 6 ++- src/shared/bap.c | 11 +++++- 3 files changed, 91 insertions(+), 2 deletions(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 1034202cb..a67e0ee94 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,53 @@ 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) { + 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 +974,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/transport.c b/profiles/audio/transport.c index 122c3339e..a060f8c61 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -1643,8 +1643,12 @@ static void bap_state_changed(struct bt_bap_stream *stream, uint8_t old_state, bap_update_links(transport); if (!media_endpoint_is_broadcast(transport->endpoint)) bap_update_qos(transport); - else if (bt_bap_stream_io_dir(stream) != BT_BAP_BCAST_SOURCE) + else if (bt_bap_stream_io_dir(stream) != BT_BAP_BCAST_SOURCE) { bap_update_bcast_qos(transport); + if (old_state == BT_BAP_STREAM_STATE_QOS) + bap_update_bcast_config(transport); + } + transport_update_playing(transport, FALSE); return; case BT_BAP_STREAM_STATE_DISABLING: diff --git a/src/shared/bap.c b/src/shared/bap.c index fd99cbbca..603d6d646 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -1701,7 +1701,16 @@ 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; + stream->qos.bcast.bcode = util_iov_dup(qos->bcast.bcode, 1); + } + + 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);