From patchwork Tue Jan 30 15:44:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 768586 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2042.outbound.protection.outlook.com [40.107.7.42]) (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 AE1E482D76 for ; Tue, 30 Jan 2024 15:44:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706629464; cv=fail; b=LPqumggMiZwJwNdOlqHG8k18cOF+Fl2auXW+O21El6yTrn2HyilvkbInCXfWi10LwJEpSSSkUGdAjGjjhyJW7tkRJ2fhle2j9wJma12isW6WTWS6F8CYfh+PkDSb0XNTfDhq7JpGy+qmCeyyYiOaBHVhNojXxq6X5BmSQda8RaY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706629464; c=relaxed/simple; bh=dfAEbepBogGG50oThiFd2t8ItcAlO6d2c2mkUxV8Kpw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=NsCbN/guNOUhfeIsA5sNe9c1rqjUJXIDUrSAEQvco5vT/2DvzERl8Av5gai68WrQMowYyMUs40/57I6z7VEf2BfW29KpKYER1wy6weDvscVAdgSd5sgIWjv+S890Fi1VWPZTsadFjk7JmJh1kUZtuu5T8OmYwSNtnzdOdNQYaso= 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=jTGK27xB; arc=fail smtp.client-ip=40.107.7.42 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="jTGK27xB" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ms+UbhRMEgvryrv0xH1iuHuKfFvINDSIzLl1JaqgPczTjQqvXxBGnJT8Nz3h1xFo3EqivR0Lsq6oNoMddOG/6wem7eoXKfNog2QHGWmmmv2FCHUtIogrJ/ayhrrHrq6BZFDvruJMbBhCxtWqsUXQKbWADtxN8MCL2rl0S/uuU6aWbctJtr1y4ihaM6SgmQHtg/7F3+egLSyAsqo2uvPBGswhozZ45L3jGKhKRF9E5JomDi/yASPk4yWz/3bKFn55XFZ80VtEaXTPPx4A0OX5oaQ+Wmgr3TVhXSygt4imEgiLXj21xIl9qT/x2ar/ed+ZvAgT7+FpxY4sGcUEiSRKDA== 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=4ltwxP8dwaacvkxdQhzspCiOzWCuk+AaeT5+lNBLBCU=; b=OyiB4qE8qiQEXPppNCSwJDThJALkWqfeHghknhRLsytibCh7eZsvmJynZdCHKfBqn0EZUTvg6OG4SbxVOoIcACIQCe30tXs2nVboxhoW/mYGO/7viNHlxxerQjaX9AVcw3thZHOf1c+NN2oT39XcyXk/sPkNUy4bhbp5ngB/HGeaKjJWB1nu+k2tdLcTb9ESIo3XsPXuBPT7gd9FbCDzFtxLFOnvSEPtg0E7yPQXhxpF/M6oZX3SgfzSXZ/wZoCYUc0lcUNx6cfqez/JJp1LE3ReflRot1mfzUIaMIktQ/UslmNYSuhkepNSYfr63XEXOcyUSn0dvGJ/UJHtqF9K2w== 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=4ltwxP8dwaacvkxdQhzspCiOzWCuk+AaeT5+lNBLBCU=; b=jTGK27xBSuiNpRCRtUJ4lAQrue2otc2kJvIHCLZMRFI9OyQdPijWE4Gv+emlSDwAGm0Z43Z8mriphxOA3eGtsG+nIBZgbiNaaXSWLN5Tc7e9KpRth8FsXxXTy5Pz4aqbDCRc828YOgIED91BSPl6En9tG08idKHJaUfGqocwRSo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) by DU2PR04MB8773.eurprd04.prod.outlook.com (2603:10a6:10:2e0::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.34; Tue, 30 Jan 2024 15:44:20 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::40f:c80d:7049:8213]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::40f:c80d:7049:8213%5]) with mapi id 15.20.7228.029; Tue, 30 Jan 2024 15:44:20 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH BlueZ v2 1/4] bap: Parse BIG handle at endpoint config Date: Tue, 30 Jan 2024 17:44:09 +0200 Message-Id: <20240130154412.3157-2-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240130154412.3157-1-iulia.tanasescu@nxp.com> References: <20240130154412.3157-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: VI1P190CA0007.EURP190.PROD.OUTLOOK.COM (2603:10a6:802:2b::20) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) 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: AS8PR04MB8898:EE_|DU2PR04MB8773:EE_ X-MS-Office365-Filtering-Correlation-Id: a1386abe-83da-4104-9fd0-08dc21aa533a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o/ScD9exsqidJBonHFUcejcnTc+o0xTxjMH1RMJJls72TK8IpyMkhVS+4JMuj1G6B2zD3yFRv4wonCh0nsk/MmHvFk2EdHaVfU/0OPsafx7Pq1w/7xr45m5TmMK8oBktlVqpY8x6Rv07BZUidDOXZrsKOAhlP6RUD0NxcoFYpjhmp3zq4et5x2gxhELyJ/dwufgGoejGy6nB7Sco/hRfuYvDPlEe/jMMV4rGQx18lVYsXHnDhtgfJpcR+EdwY10Ykp46EDIjf4z9ShqDslFGlbQL9xrxDayDrUsl6B/OWxthczIR0By6DI54r0CUClmD6YrUWyEtda99f4zw8+eqqdE4YRJB7iR+NwqXXCf7hm8scZx7XFlAN4lyhbCNnN4KDuFNNohHNSokZsHVxkdmDuvsxvwAt9Mowrv0338sfhX5+Lr8/tIxUm60W8w8IFDkIMmTx4C7EX1aE+o6FVhqqNmEH94/oBiv2lhbRfrmMFvkppxPF5mo+kEI3l/+n2kVB4S4ZhpJPRo8lR4WNjaAo9RpYi442S/zK80SbDif2Rv7LUZOgy6U0rb4+ZD5TNXY X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8898.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(396003)(376002)(366004)(346002)(39860400002)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(1076003)(2616005)(41300700001)(83380400001)(26005)(6666004)(478600001)(6512007)(6506007)(6486002)(2906002)(66556008)(66476007)(38100700002)(6916009)(66946007)(316002)(4326008)(8676002)(8936002)(36756003)(4744005)(44832011)(5660300002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YpvT5s7DWxnBDziGmeQr4Y8p49ZSHzBI8iLUMFY+OLUZCgC3Ez+cUMZuuNerjmfUvzFIaAy+C+cpQCpYPdO52YxFoA7d1ZBLNEfMAjLAzZE8NTG7g5UzC+3p4EnyNtnIMF32YJ+g9NV4P600X/+BKOR2k3fVnfzHt+1sN2/gxG77OAobW0HU92PNTHtcX3jydY0Zfa1HDkLIz/LyrkrN2SoUsC7y3hBFTyFdJAfv8YwWtgnzAMC6UfmXpTy+l2pshrURaFeV8hz0mx90aZf5iyiTWFkWyUH8moNwgKAQFpJj+RVjzx/oO3OkYz4LP/VeVDEnGFIO+F/qU5jrr6/uaTMSINmfT3ovA1+3Kb5XOef4783JiW6SSfclSxapdmQau+QPQhqgZgHOv1p0jllcONSY4dAcv/cfYqtpzQpbgKJ3AaYBy9f7lrlL1LoHPs+ArJoGI79PCs6S/6r6bKQfFZpCmSelqxfdSTnRXAJZeX27F6FEcitbkZQv/IrwrB2heS2OZ+lF+hYop+98xFBE1pvSsfZg1zaEJ6+r42X02X+arwQx49T0PeVZc2h6DyZNTbrcZqOeoW27JMxKlzFX18mcCVlLLtwvAOXhmXVSymPpTPeZTQmM2ybuW4Y+J3S4G6hQDAzG+KqqGNzgmcTiz32mqKT9RS0BzYazucnmcdUaOE7zdlxrUdjqIO74QKG9g4E5bF3DMxKt0A6ZwjC4Fv9NiQojqCVaYXXJBR18CE7geMAaq6yA0knh7OA++vKyQa4Am6cjX8DPH70tvU0tsnndfhuqWyU6zEMzAm1kkNNhsjQV4EnlcmchnFLUJrVZUibDPrVnGUj79mGeoNYV8ujdhO5tu2yByZPmx5JTe53R1pxLFvkQWxXnrsnHRV6AoRWBEwDoMd2BAcssNKp0eLaWJckfDqO0v+n8Wv0+uhl5L8OmAGjIg7K8R5QteGc2P1S17JqhMrc3mow5OrMC75NtjLwaKTUt1J93/CvBNgiBBTallES4HnXAUXgrOpbi5tZVjn6wCCGr7CieA2O+eGSDxusvcMuGuXbRz0+3nRK7RpxMHTr4ha0V/IiO0UAXYIGr96UmGv+dt2eZDkP1wfkFV9twsgvvsXqpl8IsAhDK9SPXvZbUiaOObzQSyl0G4YanIcc1CQ+h4hRfk+SIy0aznBQ5jUhVLLLrQcEG25zLNM8t5DznU2V+xVnIprgdOJgkK8FFUOV4BR+eSLssuGmd1Xoos5i5PgRa/5AgVRCEIoFQar8V5EAvCcJAAotbinI6CyKyBbKT2mh+T8ufs1wEHdwuwG9kFaA/I8ZIkO7wxFN0GqAZkOJobhw+5/PEKwOqovJ5/aKCACfS1FohlbttKdGRBZqlEz1nOFu63CkjrYmPee96cKgBEhGWq/vQaWByqZPOJJMp69c+uEaopG03CADPriyzTuFQa3bUoqWagRQf5vxo8j8VCs3eC3Y+4KLxDnOyDXE9QY4Z3sLyIKkikJiHuY9GyJJLwMXnocsm/NYF0WZSbl7+E3K82+W0+yuMpyoI+Fh4A+9vrrcCDKYOsH6wh2EA/2eWboO83Eg5+meBgzukUxYIEqBNdaL2NQPVWcyb5/a7wzIW6xjSiw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1386abe-83da-4104-9fd0-08dc21aa533a X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2024 15:44:20.5144 (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: oFUFnjxihHLnnMcqzNc07w4JVniF4doN1w1dgcMQ7Sa83rXTrSi/C5NWUghSiBF1MaF2BivgazVfZXW1Evqmzg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8773 This adds support to parse the "BIG" key in bcast qos parser, at endpoint configuration. --- profiles/audio/bap.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 007e19f21..7faa6be7f 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -4,7 +4,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2022 Intel Corporation. All rights reserved. - * Copyright 2023 NXP + * Copyright 2023-2024 NXP * * */ @@ -610,6 +610,11 @@ static int setup_parse_bcast_qos(struct bap_setup *setup, const char *key, return -EINVAL; dbus_message_iter_get_basic(iter, &qos->bcast.encryption); + } else if (!strcasecmp(key, "BIG")) { + if (var != DBUS_TYPE_BYTE) + return -EINVAL; + + dbus_message_iter_get_basic(iter, &qos->bcast.big); } else if (!strcasecmp(key, "Options")) { if (var != DBUS_TYPE_BYTE) return -EINVAL; From patchwork Tue Jan 30 15:44:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 768203 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2045.outbound.protection.outlook.com [40.107.7.45]) (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 C771882D7B for ; Tue, 30 Jan 2024 15:44:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706629468; cv=fail; b=d6Z0c6AFzhEd5snSOgAD2cBwtxmk2d+Cy6f6ydaJ9yGIkUwqXHPtPw87mx+nB1Edh5f9HczkbE3IpS7lJo8HdTkyD0Ob7iOnhPmG1SMfeJE+wNFuabVgyYD3cCurraAThMe9ILaQI41UwXXDo49ALl6dB0hd9t0n70mpLVqxBLo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706629468; c=relaxed/simple; bh=cq07RZWCCJr9WcSjjywnkDUz/r6xMuO6qdxc6zOUm3o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=mg70SloZDCpEtzbnKBiy74EUK232Cu6vHna+zPv0GOKxxjb4rQYOk84cVA9N+QabTdiEYkL8bNDOttKA/kzI88GENAw4TZ6eGhqyWRmtc2XfAuyUaVDcEpu8r886alcfXAyX84GKTG2BXrNOBGQWBviH0VZTmHkU+YnzdxqcYTg= 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=K4aayVlW; arc=fail smtp.client-ip=40.107.7.45 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="K4aayVlW" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IRZ/RPBzcMIIxf172TTWBBi+thP8/vp65i2RSQ4iaeuZwE+M7AzDJo5s+jJReSxGUttztGUj39qMmlTxwGg7arT4lcf3bI1kqtoH+RrUYqPySHqAeUrhBmiuzOas9l+Qn6Mf7L17C2z3723p1g7KcUIMUxKmhZB4tj8VW0GU3HmHWi22B/Jg7wi6a9QKbDW0ZzJFD4e9pKYW4UtdQaLc6v+8pUxa7Azsnw+qrDB5qAq+uc4RcoE+UjLgzWheZ6Ri/oy3GrSbsG1zfMTwvEXpjXCWDalS1pBPq7MoJozAThQ9ZweTfjmmzgvBxNb7ACvjuP3BmKbuup0j5S1gvFdzxg== 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=s87yWYOocYHfdoe5TSnkYD3DkXqyt7MlvHqQPI+pnRs=; b=FXOeUtJgP/LF/Ve/duH/JPc8Dwaa6PK0iNJ/2kQFDdSVNIpzHiFcefjdMJEh5+W5wijPHE3CYW3xmU/BG9MfFSg5D1jiS0tfAKsOtZ/6LsLtMp84n2I8fEeorOqJhp2dt09WZIpDO8cUdwRErdq3h2LcgzPXTM6aMO5SvTQo0kVWPQBH+UKkhkjCfP7JuBlaAKTr+ioULhmr0sLnGG5krfqPX9cyTbSSLx1q3bHAlfKvZ7TICAIpf60kOeWIhtlb5l7gliwpF77upe61dDH9k3bFF9m7dzNe6Y6F+rA1nPk4a+qntmPZg0oV/E/gpg5x42NyhfB5At+A4bGsFQuDiQ== 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=s87yWYOocYHfdoe5TSnkYD3DkXqyt7MlvHqQPI+pnRs=; b=K4aayVlWC+2BvBIejyHqKiCLDWorc9RraXL4nOeZEICDXXVOe/a0mOmPRjRrdzM0gZ9MPGxuafBpW+LiavmmUwOk3XXGJtjCZqxTbF1ZYkmGMpO/0jqGbVraUDP1eXx4xW4qjvGpGPFHKWOkUOBhwNhtQslq6eoX/iWjZ38T1+s= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) by DU2PR04MB8773.eurprd04.prod.outlook.com (2603:10a6:10:2e0::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.34; Tue, 30 Jan 2024 15:44:23 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::40f:c80d:7049:8213]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::40f:c80d:7049:8213%5]) with mapi id 15.20.7228.029; Tue, 30 Jan 2024 15:44:23 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH BlueZ v2 2/4] shared/bap: Set bcast stream metadata Date: Tue, 30 Jan 2024 17:44:10 +0200 Message-Id: <20240130154412.3157-3-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240130154412.3157-1-iulia.tanasescu@nxp.com> References: <20240130154412.3157-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: VI1PR07CA0261.eurprd07.prod.outlook.com (2603:10a6:803:b4::28) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) 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: AS8PR04MB8898:EE_|DU2PR04MB8773:EE_ X-MS-Office365-Filtering-Correlation-Id: 51332ca0-abc6-409f-5353-08dc21aa5526 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pbP0HgZEX9vo7f6oldcRtF1FaUIWGciSWSiWH88q4p5/n5niUzuFiTab+8w8+rnuEgaXU9FjdbRazGKMnq3nt9Git5mb6A9fmDBlfCIv7FJLcdddhE4R5Vd44ondSWryycvFEJJ9uoEs/3VIv4mRHmb54BJU094lOGwSI9miXwpKlIsKdVzyvDbuwLKcKu0Q6LoSMyVQDzmyoD/TyfewWFQ8f/nXsIz+9G464HzgZDcksG5T3GQBE3YNfKdnYfyroi6jjVfpZW5CvHTvHBJLW/yRGKK4y+pEQqCI1xi5qSTwVsyKZX3uzHLjcvlbVWOdDej3C1mz2p+p+FhzZ/btlCOPTU2DAOMA0CpV4g9qKedgiw4GfExm0mzY57SOmgIMyeEQLqfaxTJ1XN+kO+L008YSE/LZ4D+4e8WIxUF9aary6IwHsxDlVsR4Orsje2OKIlxqCjLDmpyKExo50ToE0UnVl0zMTlItFx47JELkB4Ah1WGbhOqmjI4v85qX+QOHSndQBv4kodtu4IVlDibbtUnj/bwOFNP87jIIgdbfo17FTjQ3/f/ZpF5xTuy//CkT X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8898.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(396003)(376002)(366004)(346002)(39860400002)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(1076003)(2616005)(41300700001)(83380400001)(26005)(6666004)(478600001)(6512007)(6506007)(6486002)(2906002)(66556008)(66476007)(38100700002)(6916009)(66946007)(316002)(4326008)(8676002)(8936002)(36756003)(44832011)(5660300002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gVfwEBR4SEB1CCCQSizj3q0bWehdNP/77Uc/fXMstaiS5Th6uO0Os6VBFdPzz4YVc6tojVHL05jUqEVG7p4Nzk42dM/tyBhJxiNtcUC1GAFYHrI9N7nE+EnV4NHj7vTumOAmvB8xvHqVU/QdHK5i0tPiTTlsQv3J2AYWRoHUKE/lJW2WgtmKtGXGnoZppgktSMp0lRhZ9ALWzJdFInM4k8/3OVCxBk+ueFhn9z740add12CAwaCpxqgo0pAVOsl5Z3g8vsDFb9hpfQHADgXD7cn/y+UpPwYxH1eD5cj7f0b4DnQiq8Vw3Gl80zLc6GsrW2oTeMCqjoof457MPNwlleAHB4ROH8fozQdBsWAJQSsCPOHVcDVVZq+Z1+7He5ZfT+FsFcHBGZ01ETnjdCpNwP3au9CyThi9wDxhAHfUuhqUKKfxEH2OTn23GtwY8+Ybmyv1wmIMbxfPLqy7/71gV1ta67MFga0maTSSRTo/e8lwCSgOc4dTrMYcz/a23OPDjMIdVTCsMXpLmhFwtea5JHbPi1M5CcPEpnE82XHWqijvtZkYRBni93UgfFZN6LKI8OK1JgddsMHSECCykHUcwP0UmBOiioRJwReAcB6eASqcFKx8/41v1PzsK1xPHPgSX6+jen5ok4yi6xCo3XZ50wS0EEqyrSKE0BowySVRVKnTWLx2kRtXpoveBPovVLMOmoUoPlP1uLj5C/oNGzla6I6A0abQu4QCY6mjBt0baqk/MCk6JF9gg6IgU80qDEQ6i2kDrxaKOyiF2iyPM2sUZ0+RteMHAB5LN2bM2O//RakRiCI05xAlC1sAmVR01PmrGLxXFaL6CKul9uGgPRu36CAjbNOZXDuU8SSzqMBpaXTHMBA+ww7O4PDOuMjh+VLnJRxByWFxSO0gdKvZm+ORpIUynv2tXxzbtM60jHnoIesVe2VLst/FLvhb3GyLmVA0aoa8Usmf5Onk89d3YnsDbh1l8R3XBexi/BNcNCOVel6Epg+G/34gG0iQ1ylJ7Bx6BLVjFoRysHUzFPSvqWdwCTKRGXeFaqnaaoiSkZCiHxoywa8ZT1xp9WmnMY9mn5w9RnPJcUjvW0f2jgA3Z/GOb6KUysffbVZ/YMmb4KaqSm8jD2nUVmnET4ac34Efmdbk7TQiX5nqU5rHUQwX1WKikPjdYwplvUKdKeDjb4/VIxOoTwrlLyIy0ALAJLM5hf75PsVsf6w+lXU11y43lik82DepkeuKl2GcBQwEe8vUFGsWLO514kZeyVERQXe6Kol+037hGE/dZI/TYJwIjjJlEnqVXvjUX9lYQOCIEJSA03f62Eb2k9gbSDN0vxlrETbMIKsLmyyzTDKtBZFVQU6+xO8+dJe9w0dEAyyYEgGkAT+4KBrrZ+0bOFHvHcLmQD1Nw+HazAFGuubqPvfRBIMBa9u4zyn4hZSZ5htxNJn4+ibsx2dPVqnMg4bewaXDtFddrQJEGoKCeu3G6kNmaib7LYMCJXXgUUs7RUL5gX/MGRwabMOtJMS9Hfe1fi+ksbat+EJou7mXyvQQIASLCq6NUeoEh35FJAVZtpn30lhHtCf57Ma6y4kO9IRtNvwg8arB4q2BPgFjhFLrTLd2DQ9gvA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51332ca0-abc6-409f-5353-08dc21aa5526 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2024 15:44:23.7444 (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: XXpRvknTG3QIUMxsOXcwJe4p9KHisaHfKLiRIJAkgqGZqnD/nC260wvEVO7ZZrTIPwiInCEHbBQ/tmLapfqT7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8773 This updates bt_bap_stream_metadata to handle broadcast streams, by setting stream medatada. --- src/shared/bap.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index 06cac5bb3..851d6a5fa 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -4,7 +4,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2022 Intel Corporation. All rights reserved. - * Copyright 2023 NXP + * Copyright 2023-2024 NXP * */ @@ -5114,13 +5114,21 @@ unsigned int bt_bap_stream_metadata(struct bt_bap_stream *stream, if (!stream) return 0; - if (!stream->client) { - stream_metadata(stream, metadata, NULL); + switch (bt_bap_stream_get_type(stream)) { + case BT_BAP_STREAM_TYPE_UCAST: + if (!stream->client) { + stream_metadata(stream, metadata, NULL); + return 0; + } + return bap_stream_metadata(stream, BT_ASCS_METADATA, + metadata, func, user_data); + case BT_BAP_STREAM_TYPE_BCAST: + util_iov_free(stream->meta, 1); + stream->meta = util_iov_dup(metadata, 1); + return 1; + default: return 0; } - - return bap_stream_metadata(stream, BT_ASCS_METADATA, metadata, func, - user_data); } unsigned int bt_bap_stream_release(struct bt_bap_stream *stream, From patchwork Tue Jan 30 15:44:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 768585 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2045.outbound.protection.outlook.com [40.107.7.45]) (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 19E7E85C62 for ; Tue, 30 Jan 2024 15:44:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706629470; cv=fail; b=SoLrXvtt0gapQajOUQCVg9f4s4DrSSXWk1vWGnuPEzCdYg05XU/hbytsu3HZXzAwRd4+x5+wXWznHPsYODhCpuCB7FyQhQknmMIc53/lLhoyiZWsy274++KvR43M+LqB6nmIDfwvkfk4+TyZJFM9kRmIY5qKHuPZnUO0u80fjDA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706629470; c=relaxed/simple; bh=HZSp5Wk4BqPgdT5j8HBfem+nO11dmKiXy5H4djWoBQs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=hLpwyp+YLeTq44g7cnLE47RQY3GnlTtn4S/mOHtrUKcOWTupeIY8BLZNEd69pw8Y6Kp1sHyMitcV5cC0pU7IGCTrEYXreICW1Tih7UuyhBGG3dhQaLpocZhjUcIELH1f96YUyAt0P/3yoqkhYR2sxIiocDn89XDqgCovo+hI3RA= 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=Ay0C3jbh; arc=fail smtp.client-ip=40.107.7.45 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="Ay0C3jbh" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XFnC7nVjGDVm4WA7ZK2LzZHkoK6ZxWpVMdA6TpToTD3zUX24qSkusf2B97LD/5qFOA0eTiKshoBhaogCmu/fSVQS44macHvqmk1+SFl/XJe9zC/W+l+VmdzALecvA7ug+iLHlHL49M3PaAAeWMs11J2vS77xD8Ilr+1rue0RmAcVlB6B0C+ATuVOsusr1tRsJeH2zhiV+is7aCBK+tt9W8KwOzx98uUWanrFKx/mOsi3ub9JONPblRyr2SEyCIyq0wYjzpyiIAiwD5r9MoGXUsJ+ys6yZRSzAO6YypgdR6bjeMYVKJQoZ3Zyw2qhslrZpTfb2Fg9wanaJLxsNR4hIA== 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=GL6TQy0ZUNVyI8LJeLo85cFS8yJhPc8+20WIHD4o86U=; b=Yu6h68HvphnwkgIzSXbDYPP6QMY4nSx0GawFFtengU+38ypGOBgCvAYxJixE7t+m6ILfKvFWk4fZl+BQSQo6NbguqkU2XdGWziezy1BvZqInE0SFR00+UyMTIedOkXV+2A7tFNaS0q7E4bkq5opFOGWXUFZhVKEsI3Qv9ho0eA1jhbzK8PkrB8f/xJyUuiVTY6fiuNp9dBc3COedJcEWCyuwp8i3MqnuE2dBp2ar8/dekuSk7gxIogd6eRG0yvYIYGHdjKdhPwfX1kfs+q85txX5zJRKR/2yIkj/MotBoTKQjPMp4E5SMG2ZBimcv4eu8Bceq7z5dF7fa+mJyOskjg== 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=GL6TQy0ZUNVyI8LJeLo85cFS8yJhPc8+20WIHD4o86U=; b=Ay0C3jbheHFomBpaeS/tUW0zBOO621FsS7kMs4RLp/sW3B5Ugw/1UwifvILRA8o7AUkTZWv3qTPhBUhF6lnW7uc2PkFb3DoXtzavAYF1czgK641hzul/7LLA35VeuWWZPPsHPwvQP/Fywale719hpnT/G9lCCsK8Ja4ds1qi9LQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) by DU2PR04MB8773.eurprd04.prod.outlook.com (2603:10a6:10:2e0::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.34; Tue, 30 Jan 2024 15:44:27 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::40f:c80d:7049:8213]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::40f:c80d:7049:8213%5]) with mapi id 15.20.7228.029; Tue, 30 Jan 2024 15:44:27 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH BlueZ v2 3/4] shared/lc3: Add macro for Channel Allocation LTV len Date: Tue, 30 Jan 2024 17:44:11 +0200 Message-Id: <20240130154412.3157-4-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240130154412.3157-1-iulia.tanasescu@nxp.com> References: <20240130154412.3157-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: VE1PR08CA0004.eurprd08.prod.outlook.com (2603:10a6:803:104::17) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) 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: AS8PR04MB8898:EE_|DU2PR04MB8773:EE_ X-MS-Office365-Filtering-Correlation-Id: ae18b18b-3955-422d-a983-08dc21aa572f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +jjVCJaN/U3i71Wn35/xrbbBa2CX7tuEyijbjUlDdrSe2lstKYwOaU+dXZy1lLI1ZeNFWR2s22+gh24pcQwDuWGaSZe8PigvAKS/ahbLeufNpAI1ur39yAIhYRbsq+lpfdMyqP7pPhUVHSI0gNVm17yRyxOHkP3zJAS+Hj2txS/xCywgKYVHNx6KLaJCNbygXBKOqEUgIAzvZPRR8t7+yOU/ukPCyxbt+t0c9MROeCYSCqAkEN+7nSeB8HUGMqgTWOHc4Vvq7nMWP+1yhKtgNJxKmBNFhu/KoHwp2/be2cv76u+XIajZbM5/5sbNBblLMkyr2ylN8XHaIg8t1YuVUQTrMJYVzALRQLqamUCTF4tNplWbHWcjkIjQFFy15nJWAg6WpcX+rkRlP74xUkZe8Q1K8BEOqJnyMe+FqtotbDRN3E/QbNQAwswQ6wOIku/0ph1xByBkmRAWwR8X3CYZXtDoU8Ag61c174CEQ+TYlO5yrjA5P5QxMfVhylTnumNrv3Q0phhM8g+TxhxWNDv15yq+zHnlIuSwTZHlp4NshNuBjmYAXt+UK68T/y4z4fjt X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8898.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(396003)(376002)(366004)(346002)(39860400002)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(1076003)(2616005)(41300700001)(83380400001)(26005)(6666004)(478600001)(6512007)(6506007)(6486002)(2906002)(66556008)(66476007)(38100700002)(6916009)(66946007)(316002)(4326008)(8676002)(8936002)(36756003)(4744005)(44832011)(5660300002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FPahT+/NYDAVumAq9cwyxjSB+ZHYtkxMCgoNwwst6Xz+O503UZWmuNWeDw1fOnAZ36LwUigvZ84roTO8LnzxmAgstsOE6W1MY/WCehhYcMblj0YPqOVqMiC0wCMAIECgvLzF+Goh4sjChSqemc8sjwcKmV6qV/QefF6ekuneCPb8qOxK0nQ2EHsg8cMlEgw4rPcCyo+G3db0IYv2+BcNeFviZEYIGgs3Js/JRSEsiAHC2lBrM+FvQBOzbyykm7E/f9A6WBX0bNswwox12SJzLxiBZxHI2auJ5MctF93XLV9xEtE5koyn+sNIvAYshcHyjyaWAiJams8U+OT4VOzJTEvqdqbb3nmaUR3XezFrsaowJMHy4WawYfp/LXdVBd8ZYDR8UyEkD6lRViWU9Rp52E2LzV4B74640F2WOMZN7ZIweMStPYaMrgxGCzKWkdRmQ3V+IEgfIc3WvCDWB6hLP08IOWCoJw+t3jsPLUkce2j35tTkXR6vMHNBX2bgO/0UitH0IvczxM247Lxcn+cvvNvd0sG9Z8KjSKMtk6JMltDmUmXpswWR02GLgo4c7t5ARbMjXo+xn3hBqxkD285ToH/O8JkE8BTXV+0LOWTbuqayNAOhrROJEt5VxiyxGffOYFYVW2M3xPpmJlVJkRhHYefxir347b7ZIaBj8weVvBdV7tntEL+lCfsdjuTaHnH8q6/PUTdG1Bv6OJvsGu64sXGuLJgpO9Lu89F4yYSBD9I2yFQ3sQleZ56Gp6HM18Thrtcv09HhpheyrGHrtE4T0CxZHUZuIYjchA5Ne5sGw2Yw0L3rNSwxG+aJYRSiQ07RXeAZpFk9PNgTigH6Xvn1ZzlZVdL2OcJ4/v39UjmXCaO8+3xaps198NhAFsUy58N/7pY8erYSSMfgzwBvdI/ZmxmeR3lPCZ6qyvdxPHFAIt2JYvhGkodpLV9VoezVO8BLptH85BBTfkiF8z2tWv9tzqdhpsaeaTUd0lKh81XJCWl4OVKep9JAlAizIPSOhbEQxkF21JuAObDaEn9YzKO1CI9Jzd56L5ODDpxHmrPVfiQeANbDX14aqXmj4oPRrgN1rTUx+nbAeBo54SOlYQFFuE+ANbd3JFKCHW+ZhnlH5DWYP+4wRjWVFR8BY8OSpbbcCHgsjgjSuLCdDJ9T8VD1VlPl6V9EEJFlasX7nGgdthD2COZIJZ2VVwU1IDy/g0YjkipBi/JnKc+0OoFOQgcxdyFvAjEqb0FFywvX6Dq7v/UP3GbG0+LERaZauZJbSlfup6bfv8NV+WZhCCuZVGH4ouHSP9u0w0F/JKOj9ghhOTBtcB7rAgGCwkc2rBOkHvmtRMZDZtETOevDOhE92imFHpl/wfz+xadAqyDPbijsHONe5mp75FJMMpDvP9/EbmVN5wHEJQrFO2eiBVxyMkHD1sXi7Ti9MMSZ3g458BQGdhIw6Qcggic/r5wS9QhENguqta9itZvItkROLBXzk0OUat/1znEoPenF68Vz99qNn1b4k27UqGv77+g9ScZZaZ0ilJvlv92G+agGCgzVcjkbl7SGatiTcdaRwomxMj9VE1nOJMG8GDuPK+WS6sZVIV7pja3QrnQc4tBgyRo1sj/8nw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae18b18b-3955-422d-a983-08dc21aa572f X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2024 15:44:27.1337 (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: FsEXiBWfXY8YeMiOfT6bEXgTl+WpJbqNDUq264t0Ygts5iG1Wciz8NKlwamHsS1lLcy4b6xBR9i9C38REz3IIA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8773 This adds a macro for the Audio_Channel_Allocation LTV len. --- src/shared/lc3.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shared/lc3.h b/src/shared/lc3.h index e6b043699..4ca3c6898 100644 --- a/src/shared/lc3.h +++ b/src/shared/lc3.h @@ -4,6 +4,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2022 Intel Corporation. All rights reserved. + * Copyright 2024 NXP * */ @@ -75,7 +76,8 @@ #define LC3_CONFIG_DURATION_7_5 0x00 #define LC3_CONFIG_DURATION_10 0x01 -#define LC3_CONFIG_CHAN_ALLOC (LC3_CONFIG_BASE + 2) +#define LC3_CONFIG_CHAN_ALLOC (LC3_CONFIG_BASE + 2) +#define LC3_CONFIG_CHAN_ALLOC_LEN 0x05 #define LC3_CONFIG_FRAME_LEN (LC3_CONFIG_BASE + 3) From patchwork Tue Jan 30 15:44:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 768202 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2081.outbound.protection.outlook.com [40.107.7.81]) (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 DE235823AA for ; Tue, 30 Jan 2024 15:44:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.81 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706629476; cv=fail; b=N3//9bp/opF8DjCJsoZifR5FWKOfN6QmZi3Rs+BF/WeNhp6TuC/c+CvmisfR/a4PndJLdeTKWXFdLWm43ABR9OzVzcUfQ8XFuqpb9S4/5WsMK33vUg5+65xHDF2ZrCW2NRUlkMozAxOk00AV4tvQK1pucsr2z+J0CzyMcrnnYjA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706629476; c=relaxed/simple; bh=v+sFMl/3GhfuNL5c+Qs39ER/BzRUSauSYohkgDZKJnc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=XHUoGCka+0XiaBwvBEGPuxEvtboMvSueEqRCmVa/SqB93ksMM7zjDiqcpFpL+Hsr0Ym+fPLudVzeX3tr78TiKKVF7ic/EKWdc27wiY2Fn/4cjzfaLwFJF7nqw5P4cFsrancdwI6ClpN/Bf3bO6dFZB0lm/GcojvZKQY/7ype79c= 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=fJM6L/+4; arc=fail smtp.client-ip=40.107.7.81 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="fJM6L/+4" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XQD1GQRkgY89jICDw3L9rD51hoVlI/XQ9Ep0m08uxJ8C6lPjA6cGaYQ6RzmPKIsVFdsaNAaStGO/5dHAxd2NOB4OmuNHM5SBZ8RL8v3vuL6VwZghgPenr8PGFk72Szs+p0DQWFOuvZEMENMO9epo5bDFPevK3xLZW6R+n0KmTJI3FSJP9SiQ4TsCagdMsQ0X4Lat0R0iO1fRWWhnH/6ibsBoN9e2y4Z77SoU/wzSzWUAHfYN+PqMV6bh106gVXqeQOGj/NKwzimKvrlr048ucfokRZBAWc3yoZcYAWil4tTWQWC7aTvZUGjE4BoUkaYLe5jkc35XG9ZxAZn9rZbgkQ== 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=MlN+BpHd15AhP3Uqf/kPSBBXxP4ZK/YtxAz3OPluqRo=; b=cA5tUtHDcQRe/yjQMhl9SWSX9gmMC+6rcE3sz5nc6PC905vETiBMoLNVxlwGGQVizGLkmfCbooZhEnlMd9YETexmiilp+aRoNrG8XIU+fWffoNkONffphDAenre/98GsCvYIqhO++nqoTLuu8Cwv9sthzTDVBhuob5q4ujwqK7XqrSZBDHVoIjnwA9fEhnEeE60+3lvZh0/y+BcfN8cWCVjFpyPsKjcXAYlVA1Qs+GNxc/yHqlNUKKi5SL5ZJBcsHUyc9RHcr1Wk+iKsaknCZBExUxuHZR+q4bjckt814R/0jb+EcfG4PGsVqFZqHV8HT0uHv+IsCbpHP2z3mnLJyw== 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=MlN+BpHd15AhP3Uqf/kPSBBXxP4ZK/YtxAz3OPluqRo=; b=fJM6L/+4IHI5ixHVUSm3LXTLXbBUHMlq8lAuqtjtYOvKVfcZ+HWSMIgLVBcEH9M6LX007gE0F/I5hkpMv24tpK7KER7AAmrwNBTei3sWzKIBWYI/nDbKND2p+tDZGuMDEARIMKzvoVUW0f3fcmDHZiOBrOKlBtRJfyZGnXMRKrI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) by DU2PR04MB8773.eurprd04.prod.outlook.com (2603:10a6:10:2e0::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.34; Tue, 30 Jan 2024 15:44:30 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::40f:c80d:7049:8213]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::40f:c80d:7049:8213%5]) with mapi id 15.20.7228.029; Tue, 30 Jan 2024 15:44:30 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH BlueZ v2 4/4] client/player: Update bcast endpoint input prompts Date: Tue, 30 Jan 2024 17:44:12 +0200 Message-Id: <20240130154412.3157-5-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240130154412.3157-1-iulia.tanasescu@nxp.com> References: <20240130154412.3157-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: VI1PR09CA0170.eurprd09.prod.outlook.com (2603:10a6:800:120::24) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) 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: AS8PR04MB8898:EE_|DU2PR04MB8773:EE_ X-MS-Office365-Filtering-Correlation-Id: 81d61b6e-3389-429c-660f-08dc21aa5928 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: p3LOs7KvtuDy8mNlVuWioRdRAJsNJuhdQhD8XRFTdNnB4ZnYnAbKd/WhoWIms/YapD/9JWX8myTCAKKYpffLu7B8jrcJQnEBMPQ3YlNeMWcm4f2y8NjFuWLtUrm8k7nettpX3Fitw1zHWPBBCpVH/1u4ma9kBocyPB3dKlUd94qGT4x8xciyRNLwp+4EQvfkyXVKhHyEcsEz/DmtqS+GbEO6ZzDOA1Hu6RHtUvsGIyJY7C+6yGpt5WfGYbH1YkaRNjmBsSjxcPw4X/InqSPN6VWqgm+SU6J5CYJX4K0eINMXcXGuyApM6xkOFh+speSL410W5ZTjCEWm4tBPUM+wjBiYucM1u3OzYmu3ZoIp5P8qF4Hz/NCBGB8maDrhHTl1ys7IFupoZXU6euoqNfcl99aJKn3wRdjJkbpE/oF7FuZCjnuFGoyDVNxqKJ4H8/c5eGVo1X3CunElSQx0c3ZT4TygP2DseKGiGTK1bCFzdTesJ+NUTTvJruhboBbe5YPnkRZqYysA+wWdIz4TcGaDOF3UeiZLNKtn8ZX1PYFuRfiOXXut5CRZc2APzutuA1FP X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8898.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(396003)(376002)(366004)(346002)(39860400002)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(1076003)(2616005)(41300700001)(83380400001)(26005)(6666004)(478600001)(6512007)(6506007)(6486002)(2906002)(66556008)(66476007)(38100700002)(6916009)(66946007)(316002)(4326008)(8676002)(8936002)(15650500001)(36756003)(30864003)(44832011)(5660300002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yXzxsIldxViO6/Nc75X0ZamOAPPTU2OmN8tj2ddVKCvubLLAJkxKM/iJ9Smzo3o0xhijBWZlNLQy2WIJIoO7woF32qiNoG+Mh3tPOyOQJTNc64+XWkCd08i2bL0483g9NJ7ZaIgORhzaidF+y0tj3I/UJwMLo87XU7RsJULKOXl1LmlfeHk9Zll+USpHuwrMOdUg7NGgVvkAdwg1oXxmWG+EkveXUafJOMOsSLLqgCxoF5V07U6oeG+Y2OY8gzwYboHkf+e4Fm6GAIlAWFx7iX3JDaILfLwxXL34jauoR1R3A2q2AZ1N7pNslr4jys11bqAabLZwwfoHBJiRaukf12IjFK499IKv57t982BGFAfvt+IE1biRnruUWDneDSEAFF6+IEnvhQxGpZIWm3J1OfgeeBEtPHFBHoaotA4kG6opFASgyEVa4g0u/v6cpBktSGqWhx4YS2HF5GQf4+REong0VvB0I91nVKMM9lIMfGZiRH2jR2OWxebQ6g4LvoADmHGLO+OJm7rgvt2yvZOSid8cIVbidqFYmqWDQI4rJOSmWQ2XrUSyQjvsJVdiZVfe8ECCPRxQ+7utEhoYHwXURViw6Zw5v4Q2tBOk/SMfkI6heJOGcAZYRYZpGrVVOijUbhhZU04ApbYFIlEmC7Vb+Pt0cRxDMVr6wodxnYbRo2pE84p5kWAqs+3h7vtgKFIVN7nPwuzVGAlsBpXqNweuX3LeWcVCmfaY8R96UdOvOSYWM6U0/A3VdqP3Vq4B3SqRedGRvJY3+rf9t6zaWXRatTCpwMS2NYmGN8Q+za0PU/PiG1T6ugRw9THvxIiFE9V2El3hDBjZpoLsnSowOEsTelQPHOIgCAeAHclmpVhNRLYWlWB4raf4mUaPRr19GO7W7id7rObmyub0nGBzk/NJ/lm5Z9DtGlKV34reBTIxA4+oTAbtFxHH4I6h8hOoVClhkadUijf/BHDGRenGx4bee2OjJzGsDAq/qfsQY/TEF2FiRGm8Cu6xu7llsvAFLwK/4V7fTv16ye4J+acAaCZVqRcnPjuGmLWy5tYRgdgouha9YaAcEZiCqQ82MAqunGUnth6e2O+TieS6aOzDgPtbx7OiZW57l6C2Csb+mxPmm1kWGC8TkE/ea5Afwb6hcvvSlH1qo/DgJoo8dq1/ZADpgB4bP8ufkJCKJwfXJo9jtDug/XcjOSZy2OskaxxnR2Trva7/YbvPaDYUlwEm3vNlG3kxhmKypAorz5JX5GJmqepLRhpNNTBHYV1BuPbh/3gSL1uNOL/xKKICRJJhJMNIrueO+7wXvSdZZ7PI9zW1lQpQf5KkSLrqmJfJuI41iHUqN1HsVzH7BPrmeGG12QCE7J7QBdI5gPms7hH19pNm3hLM+fbgEIoqsDHb9BcDEKN6bxzlh5amxh2psPf+T82Or5IcvEmRC8IQbP8use0LErgwwZ9HIsZVsd2uzi2DWUgzGtFDUBc1ns8txCNX4EwtHn0TwE3NndxxUPw+ZCXXBOl+JkAd7JEtkUMVd2VsxncuuNQ181eIfnFqf0oxFvekd/4Hy0kJZ2Pi/QvwuMIl9S7GyiwN9tZ7oLSrciHl9WiLBd4JkwIXXT7T6ykQsi8hLg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 81d61b6e-3389-429c-660f-08dc21aa5928 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2024 15:44:30.4770 (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: qxhSzZJHO8eW5hXP+cRebVlesGUWwQybB+T0XysUwfOSrKBgMqeW61iu6MkbV0mF+/2Q5Rlo5VYSzdZ4Jiu3ww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8773 This updates the input prompts for broadcast endpoint register and config. To register a broadcast endpoint, the user will be asked to enter the supported stream locations and context types. At broadcast source endpoint config, the user will provide stream config options: The BIG that the new stream will be part of, the stream Channel Allocation, and the metadata of the subgroup to include the stream. These options will be used to configure the BASE and the BIG. The flow to create a Broadcast Source is the following: [bluetooth]# endpoint.register 00001852-0000-1000-8000- 00805f9b34fb 0x06 [/local/endpoint/ep0] Auto Accept (yes/no): y [/local/endpoint/ep0] Max Transports (auto/value): a [/local/endpoint/ep0] Locations: 3 [/local/endpoint/ep0] Supported Context (value): 15 [NEW] Endpoint /org/bluez/hci0/pac_bcast0 Endpoint /local/endpoint/ep0 registered [bluetooth]# endpoint.config /org/bluez/hci0/pac_bcast0 /local/endpoint/ep0 16_2_1 [/local/endpoint/ep0] BIG (auto/value): 1 [/local/endpoint/ep0] Enter channel location (value/no): 3 [/local/endpoint/ep0] Enter Metadata (value/no): 0x03 0x02 0x04 0x00 To create a Broadcast Sink, enter the following: [bluetooth]# endpoint.register 00001851-0000-1000-8000- 00805f9b34fb 0x06 [/local/endpoint/ep0] Auto Accept (yes/no): y [/local/endpoint/ep0] Max Transports (auto/value): a [/local/endpoint/ep0] Locations: 3 [/local/endpoint/ep0] Supported Context (value): 15 [bluetooth]# scan on [NEW] Endpoint /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/ pac_bcast0 [bluetooth]# endpoint.config /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/pac_bcast0 /local/endpoint/ep0 16_2_1 --- client/player.c | 238 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 190 insertions(+), 48 deletions(-) diff --git a/client/player.c b/client/player.c index 623519209..620420cd6 100644 --- a/client/player.c +++ b/client/player.c @@ -4,7 +4,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2020 Intel Corporation. All rights reserved. - * Copyright 2023 NXP + * Copyright 2023-2024 NXP * * */ @@ -3259,12 +3259,8 @@ static void endpoint_iso_group(const char *input, void *user_data) ep->iso_group = value; } - if (!ep->broadcast) - bt_shell_prompt_input(ep->path, "CIS (auto/value):", - endpoint_iso_stream, ep); - else - bt_shell_prompt_input(ep->path, "BIS (auto/value):", - endpoint_iso_stream, ep); + bt_shell_prompt_input(ep->path, "CIS (auto/value):", + endpoint_iso_stream, ep); } static void endpoint_context(const char *input, void *user_data) @@ -3282,12 +3278,8 @@ static void endpoint_context(const char *input, void *user_data) ep->context = value; - if (ep->broadcast) - bt_shell_prompt_input(ep->path, "BIG (auto/value):", - endpoint_iso_group, ep); - else - bt_shell_prompt_input(ep->path, "CIG (auto/value):", - endpoint_iso_group, ep); + bt_shell_prompt_input(ep->path, "CIG (auto/value):", + endpoint_iso_group, ep); } static void endpoint_supported_context(const char *input, void *user_data) @@ -3305,6 +3297,11 @@ static void endpoint_supported_context(const char *input, void *user_data) ep->supported_context = value; + if (ep->broadcast) { + endpoint_register(ep); + return; + } + bt_shell_prompt_input(ep->path, "Context (value):", endpoint_context, ep); } @@ -3354,13 +3351,6 @@ static void endpoint_auto_accept(const char *input, void *user_data) { struct endpoint *ep = user_data; - if (!strcmp(ep->uuid, BCAA_SERVICE_UUID) || - !strcmp(ep->uuid, BAA_SERVICE_UUID)) { - ep->broadcast = true; - } else { - ep->broadcast = false; - } - if (!strcasecmp(input, "y") || !strcasecmp(input, "yes")) { ep->auto_accept = true; bt_shell_prompt_input(ep->path, "Max Transports (auto/value):", @@ -3478,6 +3468,13 @@ static void cmd_register_endpoint(int argc, char *argv[]) g_list_length(local_endpoints)); local_endpoints = g_list_append(local_endpoints, ep); + if (!strcmp(ep->uuid, BCAA_SERVICE_UUID) || + !strcmp(ep->uuid, BAA_SERVICE_UUID)) { + ep->broadcast = true; + } else { + ep->broadcast = false; + } + if (strrchr(argv[2], ':')) { ep->codec = 0xff; parse_vendor_codec(argv[2], &ep->cid, &ep->vid); @@ -3626,6 +3623,147 @@ static void endpoint_config(const char *input, void *user_data) static struct endpoint *endpoint_new(const struct capabilities *cap); +static void endpoint_set_metadata_cfg(const char *input, void *user_data) +{ + struct endpoint_config *cfg = user_data; + + if (!strcasecmp(input, "n") || !strcasecmp(input, "no")) + goto done; + + if (!cfg->meta) + cfg->meta = g_new0(struct iovec, 1); + + cfg->meta->iov_base = str2bytearray((char *) input, + &cfg->meta->iov_len); + if (!cfg->meta->iov_base) { + free(cfg->meta); + cfg->meta = NULL; + } + +done: + endpoint_set_config(cfg); +} + +static struct iovec *iov_append_ltv(struct iovec **iov, uint8_t l, + uint8_t t, void *v) +{ + if (!*iov) + *iov = new0(struct iovec, 1); + + if (!((*iov)->iov_base)) + (*iov)->iov_base = new0(uint8_t, l + 1); + + util_iov_push_u8(*iov, l); + util_iov_push_u8(*iov, t); + util_iov_push_mem(*iov, l - 1, v); + + return *iov; +} + +static void config_endpoint_channel_location(const char *input, void *user_data) +{ + struct endpoint_config *cfg = user_data; + char *endptr = NULL; + uint32_t location; + + if (!strcasecmp(input, "n") || !strcasecmp(input, "no")) + goto add_meta; + + location = strtol(input, &endptr, 0); + + if (!endptr || *endptr != '\0') { + bt_shell_printf("Invalid argument: %s\n", input); + return bt_shell_noninteractive_quit(EXIT_FAILURE); + } + + /* Add Channel Allocation LTV in capabilities */ + location = cpu_to_le32(location); + iov_append_ltv(&cfg->caps, LC3_CONFIG_CHAN_ALLOC_LEN, + LC3_CONFIG_CHAN_ALLOC, &location); + +add_meta: + /* Add metadata */ + bt_shell_prompt_input(cfg->ep->path, "Enter Metadata (value/no):", + endpoint_set_metadata_cfg, cfg); +} + +static void ltv_find(size_t i, uint8_t l, uint8_t t, uint8_t *v, + void *user_data) +{ + bool *found = user_data; + + *found = true; +} + +static void config_endpoint_iso_group(const char *input, void *user_data) +{ + struct endpoint_config *cfg = user_data; + char *endptr = NULL; + int value; + uint8_t type = LC3_CONFIG_CHAN_ALLOC; + bool found = false; + + if (!strcasecmp(input, "a") || !strcasecmp(input, "auto")) { + cfg->ep->iso_group = BT_ISO_QOS_GROUP_UNSET; + } 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); + } + + cfg->ep->iso_group = value; + } + + /* Check if Channel Allocation is present in caps */ + util_ltv_foreach(cfg->caps->iov_base, + cfg->caps->iov_len, &type, + ltv_find, &found); + + /* Add Channel Allocation if it is not present in caps */ + if (!found) { + bt_shell_prompt_input(cfg->ep->path, + "Enter channel location (value/no):", + config_endpoint_channel_location, cfg); + } else { + /* Add metadata */ + bt_shell_prompt_input(cfg->ep->path, + "Enter Metadata (value/no):", + endpoint_set_metadata_cfg, cfg); + } +} + +static void endpoint_set_config_bcast(struct endpoint_config *cfg) +{ + cfg->ep->bcode = g_new0(struct iovec, 1); + iov_append(&cfg->ep->bcode, bcast_code, + sizeof(bcast_code)); + + /* Add periodic advertisement parameters */ + cfg->sync_factor = BCAST_SYNC_FACTOR; + cfg->options = BCAST_OPTIONS; + cfg->skip = BCAST_SKIP; + cfg->sync_timeout = BCAST_SYNC_TIMEOUT; + cfg->sync_cte_type = BCAST_SYNC_CTE_TYPE; + + /* Add BIG create sync parameters */ + cfg->mse = BCAST_MSE; + cfg->timeout = BCAST_TIMEOUT; + + if ((strcmp(cfg->ep->uuid, BAA_SERVICE_UUID) == 0)) { + /* A broadcast sink endpoint config does not need + * user input. + */ + endpoint_set_config(cfg); + return; + } + + bt_shell_prompt_input(cfg->ep->path, + "BIG (auto/value):", + config_endpoint_iso_group, cfg); +} + static void cmd_config_endpoint(int argc, char *argv[]) { struct endpoint_config *cfg; @@ -3662,24 +3800,11 @@ static void cmd_config_endpoint(int argc, char *argv[]) /* Set QoS parameters */ cfg->qos = preset->qos; - if (cfg->ep->broadcast) { - cfg->ep->bcode = g_new0(struct iovec, 1); - iov_append(&cfg->ep->bcode, bcast_code, - sizeof(bcast_code)); - - /* Add periodic advertisement parameters */ - cfg->sync_factor = BCAST_SYNC_FACTOR; - cfg->options = BCAST_OPTIONS; - cfg->skip = BCAST_SKIP; - cfg->sync_timeout = BCAST_SYNC_TIMEOUT; - cfg->sync_cte_type = BCAST_SYNC_CTE_TYPE; - /* Add BIG create sync parameters */ - cfg->mse = BCAST_MSE; - cfg->timeout = BCAST_TIMEOUT; - - endpoint_set_config(cfg); - } else + if (cfg->ep->broadcast) + endpoint_set_config_bcast(cfg); + else endpoint_set_config(cfg); + return; } @@ -4090,6 +4215,30 @@ static const struct bt_shell_menu endpoint_menu = { {} }, }; +static void endpoint_init_bcast(struct endpoint *ep) +{ + if (!strcmp(ep->uuid, BAA_SERVICE_UUID)) { + ep->locations = EP_SNK_LOCATIONS; + ep->supported_context = EP_SUPPORTED_SNK_CTXT; + } else { + ep->locations = EP_SRC_LOCATIONS; + ep->supported_context = EP_SUPPORTED_SRC_CTXT; + } +} + +static void endpoint_init_ucast(struct endpoint *ep) +{ + if (!strcmp(ep->uuid, PAC_SINK_UUID)) { + ep->locations = EP_SNK_LOCATIONS; + ep->supported_context = EP_SUPPORTED_SNK_CTXT; + ep->context = EP_SNK_CTXT; + } else if (!strcmp(ep->uuid, PAC_SOURCE_UUID)) { + ep->locations = EP_SRC_LOCATIONS; + ep->supported_context = EP_SUPPORTED_SRC_CTXT; + ep->context = EP_SRC_CTXT; + } +} + static void endpoint_init_defaults(struct endpoint *ep) { ep->preset = find_presets(ep->uuid, ep->codec, ep->vid, ep->cid); @@ -4105,18 +4254,11 @@ static void endpoint_init_defaults(struct endpoint *ep) ep->broadcast = (strcmp(ep->uuid, BCAA_SERVICE_UUID) && strcmp(ep->uuid, BAA_SERVICE_UUID)) ? false : true; - if (ep->broadcast) - return; - if (!strcmp(ep->uuid, PAC_SINK_UUID)) { - ep->locations = EP_SNK_LOCATIONS; - ep->supported_context = EP_SUPPORTED_SNK_CTXT; - ep->context = EP_SNK_CTXT; - } else if (!strcmp(ep->uuid, PAC_SOURCE_UUID)) { - ep->locations = EP_SRC_LOCATIONS; - ep->supported_context = EP_SUPPORTED_SRC_CTXT; - ep->context = EP_SRC_CTXT; - } + if (ep->broadcast) + endpoint_init_bcast(ep); + else + endpoint_init_ucast(ep); } static struct endpoint *endpoint_new(const struct capabilities *cap)