From patchwork Tue Jul 16 14:22:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 813246 Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010035.outbound.protection.outlook.com [52.101.69.35]) (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 21BE319CCE4 for ; Tue, 16 Jul 2024 14:22:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.35 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721139761; cv=fail; b=KOGtnjRMXZTF0EqHHMn5d0AXvAnTtxxglNpc5qQwKCX47uZqoY0c5D0nTCDMIoe28XoRo7LMD5VzIy96K0uQSGItqFw05G3ZKd3EA6UHZAxziJV4RJ+CCABIUPlIL6S1amnvmucW3L4WMIJEN3Cw8XRWvu2U0pd6b+/93as6VyU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721139761; c=relaxed/simple; bh=nQEWzxtRwgqCugh2NLKyYYz2Yd6l7JfB5kEl9aqvIfI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=YMqRrGaQCejumn2vWVS75xXzCi2Ht/6+bzVSlYiq2LZ6wYJ6wvIYHG5+jVjRyEZS4opAB/q6/AIvV20FYTNxxCskg16aT3ll0yg7x6f+0m4nfy/vSuKTNdXL/JkFGH3Go0rr9D/QrIrksECYko/sF1F6mpZJZ7uFsSgEAQ4WsIc= 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=fkDPvnk8; arc=fail smtp.client-ip=52.101.69.35 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="fkDPvnk8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=b1wp15dz/jCLKNwu/nPQ6D97SK8a3Za+ScdZfskOkzywMKp///VjHm4CTS87vmh3cpaehnLWZLMy218ltDOayLoGecOB2YLoGH81Y9qLAXSBlPsYYAiI1wdr77n7S3VPg8/oXw0giTxAaOIe3tHfYAkpxbBNOzcogzmkY4LVsUYEOD/88kG8aBv4ZnRZH7qv68T/rNx5CHIqIRXn4x4MMUQ/eJRaD/JkUO35zZEtzbIU8lAK8CQ9HZ8DFWWqj2ebjQS9dYwgEN8zqszvGlQ9IYEHBfF9JGVB7oQsrjxA8RH3e6yE3sdRIFbbS3St5u+yhCj7GZndQ08cK1BIPxaScg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=1iW7okl0Vhw5cpPMCyNpN7kcen5M/3cvalRuK6PkM4Y=; b=H+jsT+HAz0vIkPc2EtFfM4hh1Fylg0Yg4cEvPhkuTqYO/wVY0MvNWO2mv5x6i7d6XFeMZUIm0ZX+qJVqyfD+nFlELTO+hRm789qMmVsWwxl5PmCKxdTB2vEVDswsIJPgPa0wq3Zp9m+6+PfEN46DJcXoNlCf+OjHcmtHPHc+4oOecGwWCN+8XyX6aZubb2jEiYrb7/JqV8kHgwhn6cERONCubqaw/GJ+qVMIscKNy0InFAA/e/qX0+W6B6DqtkkPiJhZsOhTFr2/5268AIxx53NJ+BLam39vXsHDn0mF+sF0HwvYR1qXbXa3cVPMWs8FWRG+QDVla2wqHhWLEtIQ0g== 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=1iW7okl0Vhw5cpPMCyNpN7kcen5M/3cvalRuK6PkM4Y=; b=fkDPvnk8rvMaoTx2bnFHNnyD28y+eUe6NVKbXWqOIWLQCgrdVUKoo2gxS0Fvg+aGg6kDS2Lq+xgK9+qFWpyPhW8HmXkN9IMPq1Xba2kWd9n16fgvIjt5S3d1Xrcm6b44TGjgcvSSYqD5R9BniwFr4mBZCxroPNma1AgxsMl8tyk= 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 AM7PR04MB6789.eurprd04.prod.outlook.com (2603:10a6:20b:107::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29; Tue, 16 Jul 2024 14:22:37 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654%4]) with mapi id 15.20.7762.027; Tue, 16 Jul 2024 14:22:37 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH BlueZ 07/10] shared/bass: Add API to get GATT client reference Date: Tue, 16 Jul 2024 17:22:04 +0300 Message-Id: <20240716142207.4298-8-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240716142207.4298-1-iulia.tanasescu@nxp.com> References: <20240716142207.4298-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AM0PR03CA0075.eurprd03.prod.outlook.com (2603:10a6:208:69::16) 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_|AM7PR04MB6789:EE_ X-MS-Office365-Filtering-Correlation-Id: 112a1193-70ee-486c-3e4b-08dca5a2be2f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: /oS5jQwoyxTH/4Aw2FgQu+LPcpqop+iWttztfXfC7yZbD/LNmvyJZUFRYXmKdVv5EbCKK84ryq4Nd3Lp82nNWzdrOJQEGS14BYl4q/gYcK/Be6Fh7HMsedo/5Glssfosmm+AueK6tqt7cqr+MOQgSCEB9o/LB5o3dqlY61LvBBn5YG4BJ4gApaaRIhpMBIWz/An1YSj9VRda0DKUkjtd+nso9ThP4K6P3BS1vTQVF29cuTGjEQpeG7KxE5K+Y2tKW1mmxTbIF8MpBZeg/SywV0PmKUEdYo9L4xHIUS0v75O/QnEV8ma2NuYUb2DSdd0PmIPARste3hP8yhx4rPIJsQzD8tUqQSdtXGO6ODdTIdtgajhYb9pTWcDpQNMXMWt2qagCofiDkn2/jYoSsQopNFts1UFcItrWZfR88cI8vUdIWjpkRyIaqJxb+ag1VbZa/LvP5Z78MNWQLBHIIlfglRlkTd+SZPOqP197ZPdwyrlkioldY9zrEUqQY7/G2QFnmQlrxOP0uqOnexj0AMDwTrYEpXlDaJnhwzShJpw++7c3MU8pQwnp+HC3ZlycMafGcLqvNuwJHCUSC3+P0NwVA2l202gEjC2zsQf/mhYdxII13tUG6dqPSq9o7HWXpX00G6DAJePR7gwwHU55twNzO1EY+v3g9AfvjL8f6WlxkTGSlwLfJQ/QM+OK88fuzy8Sx7uHslGvrH+510jf5+Mi5fRzSYNDDYMykTHGJfNtVrnRAkRuKLmFcpArvoDRpXtFf61bXURox6FiR6ZzObUUervP/jwB2THG31MedzVjMRDpE/bTohe1H20gEAbwH/uOZtom2tBzsXIowig0PRAjOIwyumEA2IHAbqryKH5uCuRjIX7itlV7As67Rolt7IMOa1a4DMxTrvuvKKTHWmC8EiA1Zesrm0uBonir+5JJxz12BdguyX53xAux0JOJ9aY3XwJdw6G11VzhfmA4BuUr5Me/V0LkzSwyCfLFMyq3kgLk5MawxIrwc4hQAZhQlBfPLEzI9QnZ54KcIHY3P4ptd9LkX6HfGKQAHj+hGNBhjDyYY7KEA2usZ0rWgzz3VJpsR4ovxVAsjmw+gZd9FwrOy2JhP/lpZ4wWxX+irTWXs9U1uXm2tiHnApb9JxAAJM1r1/TiwV5bDmeHjO5JQPDG7+vOov1Y376Zasop8GN/oblB0SR7D4srIqNZlTLu4hxgq6gfV38gObyceVS1QuNT79520P7kmlDHPAnDO7cTTVI/D3A1p1Hm1FINn8DeK/XLL1djK0VOzaQU/PEtdPw9pF+mLtGWuJjUnOgtdETHqUNS3tFh84/QCpXrDEhhawWQSMzcqApHWBNyuviNoYMq0A== 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:(13230040)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 63d6jxCmgp4d9Mv+iuqg05jXG5hUGmSWhI/yAfM07irAIKH72JK4hKgZXr9Z4YM4ypk1dJdqZwf2UUYvXEydJN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fDTH2dea2SMolT3QIWN1EMEszNxNGarieSPkP4Cy3mMkoVM3FqtY/Wi9LVEglb2BZHdJ4XR4XxYtyyrVumZWHvX+T8LAo5eX3SpQp7gPTX/mFCPIRqnWbzioNJ8XIgi8eUri8ZA5BPDYYG1+7SXfldEN053IEdDZc6qPmpqw/8CQR3xyA112+FmPEs8bHTGR9FzfZ/SbrqTC0SSAejADuTBx+bFd72N8kjv7FPTZp1VTgHYrlaWXjCs3gO5ANpR3wNP4yYf3rkXE2yBu3Gam7UrgFh+g92D823HCu3cjS7ZmbtnW+AAwpE68peedQGnnjuQwcrC6reKQXQCz4xdZPbx5qTuHIURjsY/YXmHpcLLwVZJG8ZGsxr/Z4540sWDT/H7aA5R0sD03mtApqs3sQuTI/vH7ngqO/FNt4Lu4uLHSOSlbnUePvId33OjylcqFQgUqFw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 112a1193-70ee-486c-3e4b-08dca5a2be2f X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2024 14:22:37.4776 (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: x5mw65LlTHryqeaYbXza+UhjG2us5qDeIHprpcEBEpk4gCumkZ7XQHTofJafkkgFMefcKy87pUH0Cx6wt2PaBA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6789 Some use cases require the BASS plugin to differentiate between client and server BASS sessions - for example, the BAP Broadcast Assistant role only considers client BASS sessions. This adds a BASS API to obtain a reference to the bt_gatt_client structure attached to the bt_bass session. --- src/shared/bass.c | 8 ++++++++ src/shared/bass.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/shared/bass.c b/src/shared/bass.c index d82c043ac..268e3bd86 100644 --- a/src/shared/bass.c +++ b/src/shared/bass.c @@ -1683,6 +1683,14 @@ struct bt_att *bt_bass_get_att(struct bt_bass *bass) return bt_gatt_client_get_att(bass->client); } +struct bt_gatt_client *bt_bass_get_client(struct bt_bass *bass) +{ + if (!bass) + return NULL; + + return bass->client; +} + bool bt_bass_set_debug(struct bt_bass *bass, bt_bass_debug_func_t func, void *user_data, bt_bass_destroy_func_t destroy) { diff --git a/src/shared/bass.h b/src/shared/bass.h index c4b5b76ba..1674146bc 100644 --- a/src/shared/bass.h +++ b/src/shared/bass.h @@ -121,6 +121,7 @@ typedef void (*bt_bass_destroy_func_t)(void *user_data); typedef void (*bt_bass_debug_func_t)(const char *str, void *user_data); struct bt_att *bt_bass_get_att(struct bt_bass *bass); +struct bt_gatt_client *bt_bass_get_client(struct bt_bass *bass); unsigned int bt_bass_register(bt_bass_func_t attached, bt_bass_func_t detached, void *user_data); bool bt_bass_unregister(unsigned int id);