From patchwork Mon Jan 29 15:29:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 767652 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2075.outbound.protection.outlook.com [40.107.22.75]) (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 CFF691552F7 for ; Mon, 29 Jan 2024 15:29:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.75 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706542185; cv=fail; b=cWzIbPr5QlDKkYGhDHFbm3AMqj1RbWLsoOKrZm94qzZEeudAKStOz7nYMAlXjznjmAF3K+HoH6HLVkxwJOneq76W/mBlSDTu0PfjrOKmY/9uXVCOmZ6tnlJINh+PEeRFoY1NPDRb2QD4LiWlBIJZu5w8U6BwMMv5VbM60NQE4yM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706542185; c=relaxed/simple; bh=dfAEbepBogGG50oThiFd2t8ItcAlO6d2c2mkUxV8Kpw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=oQBxaCZixgqCAE+ojkIu4K4on0JCb49Uzo/DIL34NtwDUZbL8q226EpS6HKTw6b+XNJvcbTsDIJS5TrRrPKt3srwWlXLcht/9gumTdv1Ez+h1eQrAfDCx7O7wco7FL9hBhHkxFvnC6E72+qoseDnzIYXZCvUrkFCrbKE0q5W1d8= 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=WmsksZFK; arc=fail smtp.client-ip=40.107.22.75 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="WmsksZFK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=izwEmzSfL5g6o4hmLPeIl/60XzAUcvpzqoXXsS54RfTWVIwdRXzpbM4ksdkP5TXaP7gSoGuaRAsl/nXPngMoXry4wE4bDOGvHHaSSoJye4r2/yBwzESP96pykCnUUSiO82xCf0T1y/k7dOm1DnWSKKSGRWV6wy5a111dfmVqD5Qej1s5Fd/Tuw8i4rQH2h2rmy5gYx8ku59R3fv0FSGtIgCoKBhh4+Fa4betjC/Bo3W1mXUGkYDRF/WzTqBkEK27v6NTcNZfQJPkufrxcEUcuI1XpnFqo8c6mIr1jBMnbmIp2Lj67LupOjhZHb3dBcREwmPen1sNz/U8DDMo3mW86g== 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=kJ3o/X3L8+fvkUImnPS62P2v5XdR1PgkyBYYS3SK6vfIex+AtWAGYwQZFv4BAEad2gEEA/CBDxPVQfHnqfj3ZJifjyy4ur7VjTRk8v8iNldrdJ13epWh/TVoZ1XEFOG6xHGLNvtA+FSe1nvkC8TFG9YUGG9GyM3M8JVlafltykKHiM2jrzmSpTcPm2M5AHFvEgY4PwGseOVNsjULlQV0P7VTnQvpKT8HuiLdhATxXBTdF4Py2pgICc7/iplail3BM1w7rgbQWD1buziKVqyvf+iHPA9hcWB7DRpHb/w1qfKxTboIqU6eGMDEFSEd2nfzbhh6O+h3nDHGperY8DNtLw== 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=WmsksZFKQJ1JsQIfmgmYOl0LeIb/bT02+6FjpfSjr76dQYGcIywZjPVE4L+OhzT0xuMya9w03edmlrGK59eBfGpTRrIQHzA+sBUkuoBJczzkGixyiRLNXUKkJTFDlYZ77ZfbxfjNoU3WoB1l1BcEveNaKp7kDIiOLFvutURA464= 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 AM0PR04MB7105.eurprd04.prod.outlook.com (2603:10a6:208:19b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.32; Mon, 29 Jan 2024 15:29:42 +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; Mon, 29 Jan 2024 15:29:42 +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 1/3] bap: Parse BIG handle at endpoint config Date: Mon, 29 Jan 2024 17:29:26 +0200 Message-Id: <20240129152928.3904-2-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240129152928.3904-1-iulia.tanasescu@nxp.com> References: <20240129152928.3904-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: VI1P190CA0040.EURP190.PROD.OUTLOOK.COM (2603:10a6:800:1bb::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_|AM0PR04MB7105:EE_ X-MS-Office365-Filtering-Correlation-Id: 51bb573f-2398-43b8-da49-08dc20df1d1c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: adDSJH4sApRfrGh4sjaJUdYxsj+utM/ndu7h9RKOEor0TSTzRDt67jCoglvisbSOIzUZnJbaR3vtiH5mBKiSicQg5xIBPbQZ6/miwyL7g9oGl6vMkgq4mAPvoBRYSENmExGbfmn+HwGCONegBT3fs+EANfaMvJB4qfWv8/rRqQaavbU8f3V3iZV5SsytEtKLlpCb1vI+nGz/qVTp1viU+Fz3HcjWRFu6OgDmbtdkbldjVXpYpbqqINRYzIwWAO7wwfntHFfG1V6EwIdy4blkupMBXtzUYYAMypJYJMLbq9NFLb+lGYUgtr0QeV+6Z9ssxIywnj7FBJO2GspP7xM7VqGhip3mmeZTRnUTMqmvcPp1Ml1jQ8AzOFXUkPHSEaKySAuGJ7yn/JTrQJYN4kkF226QCZQXsfXIM/pH9pcZoh5LYUdR3tl/IrLOQCwb3QMbrwN1lvAdGbeagPUnNjYYMF+r8gL2vQMy7nTLoYUokuyBizMO8Y2RdS/ltrRUAL40g50qOGXXMYxxyE4r5Yyg3rSSXJ96Ujsu5AxbSwbiMxtiBXozAMFFHb5DafaG+HxS 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)(376002)(346002)(396003)(366004)(39860400002)(136003)(230922051799003)(451199024)(1800799012)(186009)(64100799003)(83380400001)(26005)(6916009)(6512007)(38100700002)(2616005)(1076003)(66556008)(8676002)(8936002)(4326008)(5660300002)(44832011)(4744005)(6486002)(6506007)(2906002)(66476007)(478600001)(6666004)(41300700001)(316002)(66946007)(86362001)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vJRqtNZ5gbso7zLYuSr3sfgDrllJFKF20Am4TaziI13PCfGCGTh4Mu+vXCBYZTr8Ydjj4ffRMs6EFuzTcs6W9G2xAN5+hMe0y9gI6r2sr9LWdgmFfZGqXcmzgApul4uoCnbULrFbOhVrSQWYbvkakG/eM4Ju6HD9YivQLlJI9+MqFZyN4YjLFdkTHDwx7IGJouuICBDFsZs9C2QTJfGlsn7AF8zAuSMpkA70HWEWDeuiBLuV5W/RHqBKGU1XSa4buQYrPUuVv/XIOIm06UFFrBSrnDWChAFhFxPbXLgZJ7v67juMXMVKHPy0hgvWV+qOv2QJFG3Ip6XdGULEls8WilejdfVVK71I3FPtmpcYsxSovxA+nxdra6tLnmAekNTuujuIysnsZ+JFp77Uj0isPJknw8FULNDcY9/ZK0kphzrtox/89exK+k7TrCTqoEgRxAmo+kOS7vKECL4yldKHKHr42Rna3EFDTNHXl/jLirHziEKXwuMZ5CUTbPCKzIFyhZ2/nyJfvaliukPoMQQ9DZGGDn6AD9IY354Ap8giPP5MnCBzdAXDepDyryh27OwoDtLK5wHnRYV+iLU1r+Jx6Vf4nhjl3DtKaDpXELQmIjWzwBo6VSrboqiBHJxWYouYAcsd2mKNcfxFNKo+CKB1CKavDAFpzSPxpndMT32NScZNhcj1uyV/DwSmsyavFziwSNkLhdnTqmV8ENW1QH6tDpzbV2x7xDVVYKcAvRITg+kvdSG6IvlzzDRhf3APNQ6VTnSxdjg186qP8uMwUHLv5wnsJiHx3v9+PpOUO33XqDXfYuiO80WmmrrHlw6n3FiMLENMSDLEjKCMdZ3UGssSHNzvu51YoegjqphE6GPBJzV+BV2q1VLdZ5If7/FTHvfMl5EkNuSF8P6HDUABiUNEwCfNQJw14VQ7E9mTznKSgvEISm8Cl/a8c7jdJAHZyqRigoM1f4KlxSlc1vH8H2aUiOuTpeFWc58gsxMtXw9NIt9gOJQ4+5Ei2dGl5ADUM6eaXTbRuopI5UH0u4JQgb2gtCN7ruXqUgrKTXxbvNVHVR6glHc1X0Oo/KwAF4y4GB1KXOZOEakCMnwOfQZDW2BxcbK5QTJlLqFqZvFfHzflPjvMXwkzXAL392+dOqDaqKkjMtshEm8nAx6ATgssPQb5Fuk5JGeE/yVLocnfRN2bE7FwUUSVW0m2vjF4sKACoNloaVqkLZcACkeGEmJFTVLkEPFFOrmNDiW1yJQXbvERQEOmbtMgVSuJcoGFfrpiNsc417BBYO7IuCL8vAAwfaZidhGEhXo/01/B2QW9UgPmxEGFHNmZYu4qlmsZm12FG6FmVTJXNHMnOHv0eewA25KuMJw75BP+QX7LkLjO+4cmzxOLD03BZHtQuC2P4TdavbhtXntLZw4pvj1WnEyxSlLriwx5dQ9KTizDENKQiOiNi1E1ZG895FMuEEH5YMnin2GWPQK33Y5L3Id5+UbOjtJUFFA2GorkSJS64o/djHWjysbfOEJgHed+cG0zeeE7oIKw1yvzt+pyfFokPUobdSQpPM9Gh3bS9AaMLjKWXR0fdW36HdT+yuK0H0NcqTYmWy24lIQOoFwrWCNeiEELaXUstw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51bb573f-2398-43b8-da49-08dc20df1d1c X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2024 15:29:41.9304 (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: TmGtDAkr2HWRRKmd+dw26GlamCjrySIcAgE6QCMNCm85PfvNmSvUlqUyD/Ka2p/6Ud/MwGRgQMTK7BaHc9ukHw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7105 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 Mon Jan 29 15:29:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 768591 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2074.outbound.protection.outlook.com [40.107.22.74]) (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 EE78115442D for ; Mon, 29 Jan 2024 15:29:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706542189; cv=fail; b=tPtvjdRV1bTrJnb9l+/ppy5vRAasULFIsiPN9lip3pPpYs3NM6swvSODwvRKLbVgrBP0F3rsN7Gbq0PJ7al1vBSp5Y8inG9Z71bV8x7YSc1gHZtl0dPUtJ9kfKH0nttWTtJezLXMSjBzK7aeYwgrPEKFfOhhahbz/DPO9838eGU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706542189; c=relaxed/simple; bh=cq07RZWCCJr9WcSjjywnkDUz/r6xMuO6qdxc6zOUm3o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=G4SaVnThUlBE2NlytH4bgsyVWi8iALBewLQ8qLPBlU8B4F745ADWsMmQBzPRSYRe2OCEx36KgPUkpXMMaoocxX6EZ5Lc+2f2eHW0HJ9E7Uv34NDsap6lL+leydaM3GBWv1/rMUW4QcvHBcyNQx+fnQXscx+Us1U67OSjNFj1q4c= 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=THky6e7Z; arc=fail smtp.client-ip=40.107.22.74 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="THky6e7Z" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kxx8S+Fw9QJOWP0cQEztiEBbEPmOzRMB8CExgCWo4VAIr75I9h7s3NOMwiEEzwfyKop9l2AguVzQZ+0rXbDvVJ9qKSfn7QsmFLTztLPJkoViwG3Sq8Fe9SskFDtPCeqo0AUlscDRM1yqYw11JjbLFvGCMhSe+9RznRwZCxFnPmeh5D460gkt9JkBxYqZ52R4APXuAkztFrbAD3mXDrQ5sYHkfFXRCTjgXmya7n9BUj4ARevzOnq5CdBwYgf47RAiIw48D23cIzIoVW3oHBwvNLCyyN6yCP4cAkbL7AMF0p+mzUYJlQtbWru8fZEyH1JsEgFSQYx3FNgVzLTWHMlYdg== 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=EKUmVNFKXBq3rlgJujgZ94S1bI7J/4MUGXF/qJvWVc1u0z364zNWWjXLWn4nDXOgAz8geGWdyaDfLgHkQpfGvBJ9WHMlGVD1AWhQkk7Z57j618IulQqUOcvdGIcr1ZkVjcKbuOpQR968/YxE876h8GxTkxfPEd3FJxQk2iY9fRcjrNoB3SSAiSxSYkhA6f3RGcaY0MK2mJOI5zTLUWorG77BM902nc28dBQOXx138rt4llP0RZR7idlSTvi2J6d0UP1n7JTzZD53Ynf2/Ei4FFixUc3z8yRdVz0u0iwfHiASoMqeHgfwPaRUu+Yk3YoLdbp0jgNWuTJCUKodrtMlHQ== 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=THky6e7Zk8A191CX8GIflVrdNoeOCZCEVxwKemlz+vErHsG+n6WBt4fDwc2aclH3fLSHv2FhmwIELIz6/U3HZT6bxQyNPUNly2gr4NA7bBor3FY4UQx/00VXT/wvCmMakZQZuXz/FsUvepVKI3O4bV3w6U+tF0OktjRtLxIQ8Ks= 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 AM0PR04MB7105.eurprd04.prod.outlook.com (2603:10a6:208:19b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.32; Mon, 29 Jan 2024 15:29:45 +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; Mon, 29 Jan 2024 15:29:45 +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 2/3] shared/bap: Set bcast stream metadata Date: Mon, 29 Jan 2024 17:29:27 +0200 Message-Id: <20240129152928.3904-3-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240129152928.3904-1-iulia.tanasescu@nxp.com> References: <20240129152928.3904-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: VI1PR0202CA0024.eurprd02.prod.outlook.com (2603:10a6:803:14::37) 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_|AM0PR04MB7105:EE_ X-MS-Office365-Filtering-Correlation-Id: aef6d86e-5313-4651-6881-08dc20df1f26 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: whqDMzE8rVBlPW1E6yu5bC1jDG/CL1YFfb9YwJ15XVM1TpZsQpd6OmC+2e4TqMgXgxtQdS+01wOYWXQN3uzwRgkT8WzWNTRs8ja1JjOnQDPLZD9V8dmnSecpLjCjDAl63EtEMZtQTpi5wXhfvQ3PcwbzU8okRBDwNo1zykLgUwFKbe3IpwSbS2P9fOtyniOZjWtWfTqf7VuEr5AvQuivVKgbu04+eud/vt0BqldAFREFZxRf5GlYE86OdotZOLswdU4F3woHIEMpoAUUubzCa7TSwsVe+dhvV4DcMCdJxnZtThmYzMGw764gwqk+HKrDH8WzU9oWXLXjagkyKwEqBgpi+VgeMusrPpdbae13Z5cdNDc7mbmX5phkf/LI7sxAcklLXpY3Ghg7Mx5qTH0T0DeviYgz6ew1kYVSeND8ywceUhzVNFvAK64lJZjWtI61YZvJYY+LXbmVU9FwfssXDnchQLqoHvu3pMzRr6gv3SdB+OjM6iiG4M+hotuRyZQppJEd59ZLNCfkH8xHOZw3ESwQYkyzoGdJ8cA7FFEz55CWDagJmdem3vReOTDUX3tO 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)(376002)(346002)(396003)(366004)(39860400002)(136003)(230922051799003)(451199024)(1800799012)(186009)(64100799003)(83380400001)(26005)(6916009)(6512007)(38100700002)(2616005)(1076003)(66556008)(8676002)(8936002)(4326008)(5660300002)(44832011)(6486002)(6506007)(2906002)(66476007)(478600001)(6666004)(41300700001)(316002)(66946007)(86362001)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2iYqQRDqeJjxuU4v5iPalm11/sPjX6CGzWhVePzTGC0wQxUyfvgC7Nag1uo3UdYqck2bj4XCPmjx+sjsmqxRJf0EOR0fPXa0ut9KpwtW9u82QQupBXezptTDZTRfrYLByrpToeNLcix5/xlYUNQp1+Efnqrbh0Tu73h/NUVIey5JE5/HAEUP7tKCPBEc96Uzvw5OaXyBrV9AINfct4C+9oCaR0XCa7oOXCpkhNtpDNfe2XeVRRYNW+ljXGWDmkmq4I3x7UGXu1/dNyOAB0Mbl0hhmNyGn4xv2AbEWP/AmvCqc0PHnjXp11pThGE+UmzpSulsRg1gVtJ7q32H3BLqh1ckAS0qbnPmeZtdpXbZEf3aKHhwMTpWsMfHr7JjHT0mnjbPVy5F6KgV0fslsb0Q+cXfV2ArPmjw1y75lLWXFF/DPsAg0q8wCqK4g/NrwEd2uwjOM/svoxPsUBZvgXmNm9ZsW1InECT7cVft0QZeevP5LDRxfja08ZahRbLituKfa5ExpfM37+xEkmWfV8va5XVa7IkhT2f5wD789W72JqgspHGmD3SAZ9ZqDLYzl8i5ds4ksYtOCUHe/BQuNzvo01Qx0/G2Atw8uSFO3EAB0ZxUjlMMk4jda+l1HUsED3Wkhx5bpncEkXDV+5XfxZsAvLcFcUjFLIJHn6LIoLP+SwfKe4lQ9/vhjnpJzbvZJGTfA2xVMCUoTzYoo5XZRkTfqS9DNFcmJ1FKuAhL6zqwwiNx9FqT73zqp+QMaMR69UGpbMr/0xYcxknxKuc6EkLI7NWH0yxaAORA4KeDdyEdaAZPReCqV11d0O3MkNIMRijkRJdeLIVqNr4jiEewoSZPAYA796A4T+urhhkFBTUQJ/MWZgi5AlWIPUKG5bLaLKNQqTWYNEJFMkyKMwhr2J8MqTZN22s3EpU7EhyNIdgWB6CxhxeR6Q+aDitvl+tSwi857hUngt3T4Bm8tntPKRTXSt+l8p32+KE/MOdS+J4EJbf2ypZM3la+/i18LNU/aw3vf4LAGr7EI6yxDKS8DZKtD5tHSntjLFykC58DrxSahL+pXZXpPtbSmG8FF1iAYX9/+kswMI2qsIz2AZrCKjI7Af8iciPE2LUE7iqM+2aiJcHG+cXbiAqyg0TUFD6bJI6VajOKKqwX0a4/s2QBTZ3KCFAxw9HccZ0MJh550hIhqrqM9fJVXKrd+0UypboAgYAAmU6UBZ/Qhj6sRIP2l/Lkk3tahM7p8ouedltDRnm3HBvFpu0L2LkXrioaj6oxu3YdUxB24Lc3llkRt90AgOYd+MxB1RvTCMSmMmzSOCuB+he1uq/BrIYT8zpkHnVEuwPnhV8NxI7vCCmHcixzEvQlvHCJdbXcVyYmZDUbJkrNiyb8Bd8miwllRcQfuLJQA94tMMZjM3gMvvpq8dcQ1vOFzz9WLH2JV50kwZQmRvdrjEdE0WGngXGWuWAOajxYB1ZFHtRX6R5qCVexjqnKFhSp9mvdKCSki0l6g5vWbySK6AjPtk5Ld+lKdbxNV+89CM9aB7kGNyJdVzJPxHAHFbHnh4ij1TD5eurbuR4v337oVdWKbTutx3o/du47emsTfK3qy8GVjPU2qdPgTVGhnsVzKg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: aef6d86e-5313-4651-6881-08dc20df1f26 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2024 15:29:45.3259 (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: 4BShMjQtzNvIjtxDS+n9oiH3Xn+obyyu60u1Ki22MbNlQOdWk3rMJ0PTNHx5K9DK7zH5Eh8P4ETm3b2DLNuOew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7105 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 Mon Jan 29 15:29:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 767651 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2074.outbound.protection.outlook.com [40.107.22.74]) (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 130C4154431 for ; Mon, 29 Jan 2024 15:29:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706542192; cv=fail; b=BOfD5Ret7gLbi7k5DCkXbSvx7iQJ7xrIu5VFX7itWPnQAXcVxRv1pzdqNmAyaLFaJmgHQzaiMaE4fp3fsCLkoSSSYNHncXYnQVluZIQzXtHzpA5Rm0cOZL+i9z3Lk1FgfOsNiEbIVV/k56iyXDIXnkRauGPjSGbc1A8R4ilKezo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706542192; c=relaxed/simple; bh=VV1j2yuVP3uPULRHO3qeVB5rv5G6dvPnPZWDQV1Hmok=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=OfG8x1qVm8tNjg5uJkNgCRDzNES1dLMw/8r9MsJou6ibum8YOiR2p5OMqqKMmnF6kAaMgT0vAf4nxJSt2RnXLu+z5JGgCk73nY9q/2X/bF1COVJtsdYzW02dkc/W1nUFlzl6MBDjm3jKGWF/SWxpUEhIuBDWjITnudHPIBZbsD4= 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=kPBV+eNe; arc=fail smtp.client-ip=40.107.22.74 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="kPBV+eNe" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NFVXhDnfSFHncsviJl0oBFvOaHbGdIaYxYRosBgd9O+jQiMR4C1RufCWlvJad/WVIx//ukQ372bziNrBYdvNPWU8Fo4tpU1N3Bg7WwAqX21fn7qALskj8EfpT34VHHYlHj1DeA+0Y5AHEmLxjYf3mVAeWJGY3uPgCIp0LpRJ/ipIO7BvGhBv80OlJlymbt0Q9s9fwWfcOEvX3/uEfVAlcD4fZEaU2ST54M7wx0NkGa83woEFF4YXoAyhGB9zj1Ot0Fug+XQblEO5sOQJ33V7ewnT/lT4ynD2SrGJTDgzD6XHPXXxqwVXu0Hyrj+7d8w11jajDmjlL4vyul6UCVRGVQ== 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=z5IwxI3wwC78npt+PMVMZGqWsg3bOMJSp+nFxv8ZDks=; b=Zp3T5VotaJvRk5Fe4DYmyQZJADgoLBXpbbzp89LROv2LiKuKNAuP+rc3gCqM5u6fAiLoO8kL9LmYPJJWz/yZWXToi+EHQgzNcuqHoz5MHwpaEFTIGRPNwRH1rEZZ8TSQvEfuJhGGF2/pGFjyt4OmfIljh8xUQHIX20TwnQiawmNOoz7R8W+QUUAaHqjr4h7Yb8tYW+Es/0Zkzcc53mu5QnKqCmEjfG0tL/G4kwqy1OU+IyAxrdz+l7GKuEUpD0uwGrUD+x97c2sZZQc/timnV0ztJL011B4eN+IDB2+4s42aB8iXvXEwkXwGzDfAOYFO+uTadAha8Fyk4vTi7rmVkg== 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=z5IwxI3wwC78npt+PMVMZGqWsg3bOMJSp+nFxv8ZDks=; b=kPBV+eNekag8150JjK3Ncx8nDnS26UORNwZJJAcvcA75PeJXKUrjNUbBrceEsjRGCsh5nthFa7Bu1NJPM7ioPcAYPuXs+uEzG1Byw70140frpfyO8vSqjV3FYuycsrS8uN+PCGqnMyqMJ3jU0VfmFxgFTCVS7mX6EACQGph4Z2Y= 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 AM0PR04MB7105.eurprd04.prod.outlook.com (2603:10a6:208:19b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.32; Mon, 29 Jan 2024 15:29:48 +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; Mon, 29 Jan 2024 15:29:48 +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 3/3] client/player: Update bcast endpoint input prompts Date: Mon, 29 Jan 2024 17:29:28 +0200 Message-Id: <20240129152928.3904-4-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240129152928.3904-1-iulia.tanasescu@nxp.com> References: <20240129152928.3904-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: VI1P190CA0033.EURP190.PROD.OUTLOOK.COM (2603:10a6:802:2b::46) 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_|AM0PR04MB7105:EE_ X-MS-Office365-Filtering-Correlation-Id: f7c96dce-d5e2-4471-92e2-08dc20df2130 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 57cF3N2Pq3WNSWk9O9Q6jra/Dpcgj30GOMq7m/WnszH8MAKXx45WOW010kQFoRhP1RkADpzu9yE9g5yxsoOmeIKR0K6ZNSP1vv0a/uZjH3ORMCvIpVUTIbhqQJpWp0aPGsi3C181Fc6eg52matgLM0F+ebsOGuDaYeF8yepV8V6bYxhxuACx6RcFiBy6DVedB14DOsO7O0+7wc92e5X7BGtSKB7s8tzF9kgYAeeEzCX9R1SnNnOZLgfKgz8rJt2bqeSGrA1+9LV/7orEevF7V78j+BDdmn0kE2ZF4Mm2h2xv0NhXU1HGlezBTWFaK/orVV/ibo/xALXpk1ibUztWuwI6HxQA0T8RV1nuF8teNnslwE9W8E5p10iPXqWYCujQ5o+Tf7tgY8BvNSILkGx+A9yn2hXolfRda3o0tzXmapTftQLeGfQ1EMrsjPhQMz/xdNjhhhW060uFZmpLQYCajLkcsQvJlOQPuhm+laxnY0Y6eUK2ZW8ANrD+eaGaDUtpqavp2yEcOsnY0qeZSjOaE8VPOECL3+M1Nt3m9c2bRXGEhYPX98VqCfQfs/5O6mPS 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)(376002)(346002)(396003)(366004)(39860400002)(136003)(230922051799003)(451199024)(1800799012)(186009)(64100799003)(83380400001)(26005)(6916009)(6512007)(38100700002)(2616005)(1076003)(66556008)(15650500001)(8676002)(8936002)(4326008)(5660300002)(44832011)(6486002)(6506007)(2906002)(66476007)(478600001)(6666004)(41300700001)(316002)(66946007)(86362001)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SG5DJux/o8kPIV++0QxHdFFFzPc/81ClXqPltmOxchkKRL9BamfaWn7XTInda7mtM4GmjeER7T/+dMtB1pYkyp+UXUT2RtWcQEyVymVJCEXsTvm27noU0rni3tRVwlKiqXn5757qRw71xNIXywyWyNOA9tXxp+HkgaGepx3nzkFoKy9KZ0AYtoxqBRBP6tNFFgMj71nZX05j3baTJQrJTiHo4HDGnLJMBCa8fsCYq9Sld/fBnCuq8/mrSLVRfMDWuKDnOBfWJVSU2af2Yew31zlxG+SGkv/NnxenUeejh7X7Hl93V+ZwFgzO1ub9Gm0gQzq/09wJ9mjNIFWAh8HDBhr560aWuXHsOhluyaxX2nIEfr3BFGDEBA78amyR1pX+yxmAsgBV8Hcn0MEuE57DjPq/08pLNxwoVhMizVBi5WAHcxEHAQO4FUZz7xdgMxTZpINx46F0dMs1O2ID4b/SxkZJnEwbvy30Hq2Z7N+N5ROiiWxUwdmNhOxaVeTsWwc7QK02Oa2tEak4HP+2/n8Bdr1KNd2GTUCSFGkjow3Jywl6ngAZvZ7K1JPAQ1iOj1iGVwhBp3KJPSNY3ZLuVIp0pfLHvzKIjLYW2+nXt75sGNrGYqny/nhl8FRezRbqmO/1V9DTloOl0lousbUlN0PSvA3Wmct10c9Es1L3qg85XXdCFbXbFfvVCXD11st7V5K4YZid8RBWJQ3QnSftxC3PHfRzOfDEvvZd+ugD70HaAsTDL5hwxyEY+b451d8cFBeoBw66txCdSudv/aTCSI43vxc4EghRswJ9hkPKO5P7k4TY506qYmwib6/o+8uxuEnSxBSSe0pwqo09ZwDYJvoQupOJFeYkBXXHDEJ41JvC/DI9DoVNP0Kw3b9Z2MqJuBANCvoEjMmGa4G0YWApsSyMbLhILAhAym3QFmGW+cSgVY5S7Uwo1xEqaMZ3O6VcDRFMYhBwxQ5fyLaH5pmeafS1iz6errS9+QaqqrtVVjrDFJTvpS01zQWmgyNo0yem7u/zVwHo+HcjGnuiGOWkWR/5UyflLUwSaTgCk9pkERj0C+k9QtkJFj6lgjXI15lZ9vQS3lWOkwTSFO+MbEG5v3X5yUz1FRQY0Qf1Qymeq98foGy+yzK94RRx4FtqSBgq5D/eqAaDdp+y8MAmDj2JP+cCQEYmwUb4OB5tYaUQQ9tWo8zitE8RxwtezVbO521PzPc7N55kdoJ11V1h8ZG7Y5KF3YI997l0g9ol3FvQQbdIh9ieHefeuGs4m19pX4y+QTm0j+mw/LnNeqY0xV1lGS6T3w27ZBJECpmCswgd0I5eGHWfIoeyIvaEX529YpDdFdGUuZ4uo+UeK3OFv0lI6mzZc/TIeHwRB7jYD5FKXHXLZoBwHSFFfgt80lKeitXsEN67xs4TWcqOHtPSUmStmBZqGvc9LScmPnEvgWHpBBbSGFIHnArR5lOuQkkSB7xvMGIE2DRmLppbff5snZLm0fo0ZB2dQ519ikVOn2iSy1lFJK+RYzZFQ2l1YeWOAULuspW/ftlrIGRsWmYpOwh11TwMqDWBKpv3UBNs+TseIFbVXJ3kpoFBP/tGflD1gqYQBgK5+oXheUiKUaaTj2LlLrEjHA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f7c96dce-d5e2-4471-92e2-08dc20df2130 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2024 15:29:48.7517 (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: 9ABIBYr2Z79uafIoy3kLwz/db9Qu2Bz5mSkwgSapVwizFDfbABuSy7Vu0KC1s3KqQLGgJovSiU8BXT/PEGK2LQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7105 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. --- client/player.c | 186 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 149 insertions(+), 37 deletions(-) diff --git a/client/player.c b/client/player.c index 623519209..d9a4bce87 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,134 @@ 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 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 */ + { + uint8_t ltv[6] = { 0x05, LC3_CONFIG_CHAN_ALLOC }; + + location = cpu_to_le32(location); + memcpy(<v[2], &location, sizeof(location)); + iov_append(&cfg->caps, ltv, sizeof(ltv)); + } + +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; + bool found = false; + + 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 */ + { + uint8_t type = LC3_CONFIG_CHAN_ALLOC; + + 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 (value):", + config_endpoint_iso_group, cfg); +} + static void cmd_config_endpoint(int argc, char *argv[]) { struct endpoint_config *cfg; @@ -3662,24 +3787,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; }