From patchwork Tue Apr 2 11:43:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13613785 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2137.outbound.protection.outlook.com [40.107.7.137]) (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 EBA55664AB for ; Tue, 2 Apr 2024 11:43:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.137 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712058220; cv=fail; b=IRht1NO8yQiSDwZH27oXQYS3A5HkGSUxGZAvi17nBdJIwCWGOVgr1OgPho3CSF9BN8c3u5mRYpk82xmgiawhLdf82p+R+9OGYt8XMexG2uxWqAVJjXhgXuOql68gCbv24TitReciVPbtuX0AWEQC0tKFrBQFjooh5wB++Hb2od8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712058220; c=relaxed/simple; bh=PI1xJ2t6ehzXgmf8DxtgMo54lsM0yjZZse2GrEcJLH0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=QXnokbYUr0lzik9MvLN7fesE/Bm+oE4XpYnjmsuNvm6tuMMogR43V3Mw+cjS7FvqRDBzEwGh7P1TuJ+3MkbnQ9nt4xKIT2wA9RucfEL18+j2AF+87vGpq1hPhIGUPjpoewnuI8T3tvL+7k80DeqrZi1L6zoSJR6/Axc75x+st5U= 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=BRVPjYxf; arc=fail smtp.client-ip=40.107.7.137 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="BRVPjYxf" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W7OndRqueRsSpmeTDMrOT0I72cG+Vvr07mcJWcZejjTuEBUh9o0A1z+ya+ciFEf7lcysbk8985GKktdsxAq17YX3vAHDwCaBlf2+BGjq4SNtuoFVg5i55yUyYrY3Rbmy8s4zoONqHliGYR4Cedgg++gqVlEbcDM+aKd/wei2DWCa6HTnP7C8gJ64GbKZOSuSwUTRfZBkLrZTGNG3t939Vahb5/0wdqEjndAYDnmshq17RVHiHM+6QBCYn25v4/KoGLSMZTBzxy/iKpg4b9EGrVgqYTlZP0bf+ZI82huLtzbGVf9wZ7v0FXR8NEVeYY7ud/PCeQfgJ+HOlteFBZhgpA== 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=R8Hy/5IWYZaP/7qnIGFtGP0egtcPXlcdmYboWt6Yro4=; b=Dk0fkASV0JaSFE+M5v6yNgFfmHvrkIEeoZER1qOIPPHictTlR/+0UI8mtEPaytkdwJo6wdIKiCyC8SnupPgVq+3BB8iD5StVLWOIg6Jt4Rx3389sAEbTG8Ai6sI+JxkB0lSgKhoNjgNgo260EW9Me5IRQIjL9N3QQq2ZE78OJeoJ1YrB+41uceTmkrVlHODunHUdnEALONbMo7WX3ArnJlpmXCcjRbq1Fe7OArFz2Csplc3Q7j+PWoI1GX3hCIOdSoAnj5/M1O9G2dPEpAY9zE2wSi4Mx+LQBijS+UwdM9pLlLrr4f7X41/YSuscGIe4q+0IfPjO2LU/ykXVD964Kw== 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=R8Hy/5IWYZaP/7qnIGFtGP0egtcPXlcdmYboWt6Yro4=; b=BRVPjYxfsjS6D/6Dtdz7GJij6U7swikUob4odVNIOxEgHNE/vqO9yE4dD/Z6UIebePNmk7hNCn/6v5Au6ZV9D7ELXFN5Qztf33duc5FObFN4+bFegpDv96Ahv2e+9Qr4gwY1dSgtEvrijgsVtWcBikbAhJ1GMY/EL8didHoqRFI= Received: from AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) by DB9PR04MB9498.eurprd04.prod.outlook.com (2603:10a6:10:360::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Tue, 2 Apr 2024 11:43:36 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::c65:a818:c6c3:679f]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::c65:a818:c6c3:679f%7]) with mapi id 15.20.7409.042; Tue, 2 Apr 2024 11:43:35 +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] lib: Add macros for HCI_MAX_PER_AD_LENGTH and EIR_SERVICE_DATA_LENGTH Date: Tue, 2 Apr 2024 14:43:24 +0300 Message-Id: <20240402114326.3330-2-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240402114326.3330-1-iulia.tanasescu@nxp.com> References: <20240402114326.3330-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: VE1PR03CA0012.eurprd03.prod.outlook.com (2603:10a6:802:a0::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_|DB9PR04MB9498:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pmZtFx3WOID4/sA6Rt81DHWMsJMQtLjYoGgv63dqt6UiEaTUNHTpgT9RYPwmyeHt5Hgc5/VsmwHOPwIlucGjbskmkZhrEgVqdJMWVX7Y8PaOE00Qyo+JO8gLr0PPTwYAovp9C0s1Y5T7m+HDaAp7HLT1sdL6aTxSpGT6wG0H+AiE//DADDsOw2Jy+yAh1tF6c61mQug0V6VIYGOMBlMa3WE0sF0cVL5MeyDVHVvzmcGXAF4L99tOWLRfHNcAeoCl2i9HPzrSpJM8AUAfSc42Mr4PO2HLe78gN4aXD/3fowGEuksTtOBKRU5gDgJS4ArRPycuqR/NSCU4DjbLuT7pQ+tIJkx+SlhhGJVuMW63px7/FcppKNTS7gnVErECQhEJqGvrCHqKAFskJZEkjnt1XDPhENjs8HSMzYsrrnzCoc21kdexSdvyQAmT3LrI3kQHxkwcCBDsDRcJ84mPNrnWrLxDzH45yyto+xnzKZUeP66UbJ2gxGo/S4fsxzAwUXEXYJWIfmJDUnYY/RJN7SW6QhrRjqsMeVokR6vonANKTF44qRCsnQfT/STW6w/ik9xMuXCoI6VAsGqkDio6WMxMspjk00lP9DpWjr3mQa5SpHOL8TYdP17tC3Il08EiXl7smOmwP8QW4kcai3RaAZ8dmnHnchfBQA9o+6QFAnesBJg= 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)(366007)(1800799015)(376005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MsT1TX0lAFxgeT773Mu59VavzNl0o5lNNXQH4tR8divMPJynIa90kP8CkzKG6dcGubKWtylrsVxeWJ1f/ewbC0bJmiTh3emtX5Xp+7LucyGbg/oSVuCsEm9yBzdnj/xpgiwj+tyN29MOjCM0BafGgqlLuH9vgnqA20OtJWI6j/APCyxb8FdWAKNoQDfDu9P+JmgmK+2T8/8vmACWIvJveXNuZyWUHbK8rFOkLc8BxsMKfHePdvgLJjN5vJ91K7tx5jqzZ2q3JISuIrU4X+yGnW6DcYeEds2eBuBmgy2nRd1LF1sXyizVnqBQZAOz9/1Kn7mTjRESW9VSb+0GlOYtP4JqAnDU8HsTr1cnU5SZcUWOF8Y2mpgs2ZOKFrXznaBmQVLvIjJQgErdDt3/WqW6DNZUSt3v1z6H7Rv4pSAgjYpfVKVuB3lbeYT6sY+W2jBmod8W5i3CRolGYozefgxAtIOf1PY/fCRnGbm780OfbBqqdexJU7SfwcUIFws/xYkaCoATFXtgE0Wdh5PgvYDHxA8RWJejGBtqJp5/7aDy+7BIGiDqQmyWq9K+jt5Ysggy1wZG0n1Ie8yPXzAh1ezoKVme+Fm/sQZtQnE+4ceRtM6qXhkUTnYOKJ4S2q5FtFB2aaBigevnYVCdnX0vh2pKvGhHsjNptlAdCLgvu6v5s7f7Lt2nZZimwNNQbWnUi9nx4xk337/8vA8pEHLztUh1vyd+mJUkmhpMwJyHwKWC6X1DvEhbPaOGKZO+p++xCJwYMco3QnOxmFeWLB01mEPdgBA+prCOzTrNVoIGhMZLid622ND9sh0iWilUFSsmMT7eUgbLWAIR+lSJ08/PPPoM0wWHO1ZJHcOveZhmiYAKq3rLpvF3JV7kd8AD8WVVTCPJ5M3TL/XnXzqhLsw0x1hMlrhKjM9txW1hOQ7jZo1toACRHuvc5sgYhwWugSWvftzgQ0kHN/dXBczDeMh2mMJX7Us68vlXtbOxUZkmZHBbGQ1KvWC+vAyEQI53Flvmza6wMggp6aWrQ+KhjG0TJ+af3XrYSIlsN5CKsXnyBwoRFdVwKQTbPPaONsDEWbQEfi+HBKELVAvOLsyDcI8T9USlqxlT3hTos8MUCnnA5iajar8HM914nOIBcCCBKCRaNqJfsyrl9VPNwxfGXvsvH3zZwjj8c0onzYK2VOc1wYoR374/ZKwLuFIA0MrqpLS+ewH/Wx4mC2ugkrFgDXNsIl0568g50skavBCxWZF2CQp/AP9UXvelWu5o2GkDjCgIYNzqimT34fWFO9f2ojf/FgYJqPbwVK4RWgW1B1RbkZGwfhgwAYKYjyg17yNLxTK9o/Ba65uafvXTcO6dgx/lohlB79AGkW8eHgzF60ADqZ3AeOnU2z17ffrCShD4gzff6v1obA1WBZVpWPQp07x/z+wX4IBY5t9Q+liRTXOJhdUeO/50AXRyoCGICoOegDirL8jpmY8jdxGTxQgtB7kCYkqaGR0P4HdxNi35DuhGMnX7TrEmNNWrAEt1m/L4r9ZP16ioZraw2M/dOG/OiaufQSJvFC4z+qUIEqQTOwBjolzKpoGyijB5RbuZoTAWymro98HbsIvnKW5a2XpLmyHRZOHTPg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c407f8cb-d77d-4623-52d5-08dc530a2197 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Apr 2024 11:43:35.9176 (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: LnU2Egyt6ugTLQpg+VLV0E8tfGzYlxRLTILUYJayxBU4pxsPT/iSg7p630cInFeMEmfJvRIeGpLJaHI/CuWHBw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9498 This adds the HCI_MAX_PER_AD_LENGTH and EIR_SERVICE_DATA_LENGTH macros. --- lib/bluetooth.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/bluetooth.h b/lib/bluetooth.h index 75dc960c8..f67d79f66 100644 --- a/lib/bluetooth.h +++ b/lib/bluetooth.h @@ -6,7 +6,7 @@ * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky * Copyright (C) 2002-2010 Marcel Holtmann - * Copyright 2023 NXP + * Copyright 2023-2024 NXP * * */ @@ -191,6 +191,9 @@ struct bt_iso_bcast_qos { uint16_t timeout; }; +#define HCI_MAX_PER_AD_LENGTH 252 +#define EIR_SERVICE_DATA_LENGTH 4 + /* (HCI_MAX_PER_AD_LENGTH - EIR_SERVICE_DATA_LENGTH) */ #define BASE_MAX_LENGTH 248 struct bt_iso_base { From patchwork Tue Apr 2 11:43:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13613786 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2137.outbound.protection.outlook.com [40.107.7.137]) (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 86AD667E69 for ; Tue, 2 Apr 2024 11:43:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.137 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712058222; cv=fail; b=PN+zhSduqQhQk02XfQ/09lOltj8UF3rD2KwkLoRMhBp0zmFnj9XSY+b/Xyb+IPZl1fNl+htGysWFuFZBU9/QQzchiW7UCDrikomBu3cqn0bzD/wOsSXKi2uRCE26HuI8TORdJeOBkfP8UCx8/iXQCjWBg9mtad0ooVxvCjRWhK4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712058222; c=relaxed/simple; bh=8CcoRR6WEcpcLuRsAo4mKv7IY20mi8KKLc2YW8hp5hE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=NHFOUiPohZtLZmdKqtiSChBiPFO8ZJYYOmWTvfHYK2BMsTbXmVTRAB6ZWWCCiECVmhHjZMHi6TSyMi4E01Pyv8jUPvT8FBzsBERWN1YeVw6qIbB2OqaKnl4nbgAPi72wqaLPR0PlaZi0XOXFojq4tb8B06EJIa190DlqBj9CgS4= 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=Wt36CN3M; arc=fail smtp.client-ip=40.107.7.137 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="Wt36CN3M" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ch5UPjQNjqwH9PN6NSdrW7Y9xtfO8P8b2DbGUehVQaiw4//4XX6fDaXI8peUZvfZTemCk5ssPpcZIbPuDL3Eq/alvIDeKXEsBHm7q1vE6EKmbD0AjilsaMgeC6YZXItwcXHKdQXrOyad8q61kkxITnznUEa4xtC+2pKrC2Sv86ymyQ9ZNT6HL05MbpR+fa5rydsy6Hwtil8e+uGwsjdS7/efVXuflVgEM5cXcU/aZ3KY1AgCafHnomvkO7He96h2WU2OaD5FclkdXEcicnBC4m8eV+kLzmQmg0BV2omFHcWa863CCVhaCffL8Plnz8Gl/6vzLGdbeu1tau8TRJT8Fg== 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=34mNjN4f6XEXOBVPsnxyX1fc04oP3c76IhIrKYx4gGE=; b=gRi3ehxOXoPPlvRPyitnqZZGWrSWkUH9iDDsqrRymhy4vbMNXiP8sorfpzBn3/gwveqDon490gYJmAPYr10PrfG3eLWF7cUJEXcEAroxz9m8RQ3XBHx2dl0VqHgoBkSPGIHnhRDNcOQwhM3oAvKeYC+bpYFdsPYz4l6YcPBUvgHjbbwGyJg60qR6gFPMgLQbDZwZae2fu2oPdPgYpnqPDCgQR9j5TvNwgbgKHfGAAERv+NuPiuWsqFpFD91JDQLQ/iflwEap/xf/Bra0d2D+nIOXtb/bbUD3F5sA7M9B2CXU1vbdND1+5076y4scyZ9f8TPOsaVus7lCF9T/wCYukA== 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=34mNjN4f6XEXOBVPsnxyX1fc04oP3c76IhIrKYx4gGE=; b=Wt36CN3MUUpwkQUrnh7w+8/0XaTiFW5Oyw7r5sXry5q1SAUAHssNvSt6ZA0xBaD+5sP/91BiTG61M21LtGKg0bdqEo6vCb6X3tio425Y04aVFk9YRjZigstRaVAcQcjDMxLhyLxGvH3u4g02pue9tlXqjl+WotIiIWan9+/G1Ak= Received: from AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) by DB9PR04MB9498.eurprd04.prod.outlook.com (2603:10a6:10:360::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Tue, 2 Apr 2024 11:43:39 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::c65:a818:c6c3:679f]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::c65:a818:c6c3:679f%7]) with mapi id 15.20.7409.042; Tue, 2 Apr 2024 11:43:39 +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] bthost: Add support for Set PA data Date: Tue, 2 Apr 2024 14:43:25 +0300 Message-Id: <20240402114326.3330-3-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240402114326.3330-1-iulia.tanasescu@nxp.com> References: <20240402114326.3330-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: VI1P195CA0039.EURP195.PROD.OUTLOOK.COM (2603:10a6:802:5a::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_|DB9PR04MB9498:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j/8yN33WTX5LPjZ4JOUuyXp55Vho3LA+KLvq+oNy1DLcYf3BGpG1kyD0GjDsepRImWkWo7pCKaSFRSyKZYBfTtUbt52MvAmG1uO5mQes4APkxTbresFLboWu/TNcAc70YceI6TXFP3Gr9I7pRxqu9P2uylsOzK//Fp798FBIUUqAL1ixX3mnYi8HgAzIma+xriqof9gLdS+Xzts6GLfVLnvPh2bKURfAv5olXKIWVf6hewMiRVtN0yCzRRzOGUH3PPUuf9w2dc3zyTsvuEdBkA6C2J/JhbMpeGdDrcYD/Mb09W6WvGumbef+FNeZVu1vkoP8/1/RCm1bR+LVwu2t2dDklLtSq+s0gIC32DQlhlP/5+DSPT6YTRqTvW+05uf0AH6JVbcfTg6hJ8fjRabdai7MXigp6oWfx4Sn3dbkcJQZHVPdeTvLQy0JnZ+uA3pabTlWEP6X9qNsqAaMweO1eLLH759cWKGPfIuWbwF5DwWsz8k+59ZTMYw9z2Z+ih/io8hNfkWG5+9UYTKopdenwS7N70c3fVO2KFUeb+kBdn+/CeFfDWdMVJp+egEK35fkRtNoJgSL9YYs89M29/sW+rM4T4/RcqFxX43iiNcdv/DgtKiTmjiQj5CwfaosMOm09j/vza4pC152DKIkEB5fjbhNuV2uHE3SoWv4S709dME= 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)(366007)(1800799015)(376005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5kvHWofzMbh79cFcqL9l5/0PfGGvHOizga4Cfc7pUK/WP7yWdTFoA8ODqp1vvfj17dUF/wfYKguITd+zab5F8VRdtGpqYl8ByZ8FOFe6jb1bB9E3iRIOQKRUlRIMlCu9tzsWsLIjg2G6SNS+03nAX+69emJRKONOri75on86pYSZ5HyngA0wzp2sB2oAaLDnDciESfkvNw5jUMFw4hLZ/rYahwy01PMhRucwfUPXFuxHP+3Lrq++OrlZThO5LWqUiNgjpFz6SRqoXtqVRfVd31bNNuw8Z9inVZv7dgClKhhI0WncbsqxdPBPnuS0Rxm2bJ3aT0pq9ZrfYvQaLzf8R3cYgtGZ4uUvjku9f4DELx0qOSkJ+1P847WiFdR5OJVcc5hQzvGYeZ8JQ+Veo8dOLYewpVAPoopy27+rWa71THlNK5LPonG+x1B40JN4QkUklHlDYcdTZji41MXLwi86hWo0ShJXOYN79ebbh6OtJPIByQ7qrHa4moY/11invdRMXW6cSKLFk6TyFO+4zhFe1QYXOINIMQWdw4vBsDkujhoVlOA4icYBDO6YLSnBWt092jL+ugRk27w06q4DAHZ9WvLKyOkh9uwuO0e2WqfFRPpwT2dzORcJkDLdhgytRJ6KxH02wA6O716y+SgLr3affGchgAOnz+GvT6ysPZnnrHcQg/6xnaaHmYcF9T/l4hQ5cs27Yp9zFlsLSO5zCtJMICAj0E733Gv/mhqGZh6Yq5sgi0RobDdXTdnWGgQQRKzTmu7jmmwT+J/bVfuVjF/GaXEn/uCrBQuMquJVwIaL4kkCZrrIDuC88nOjtvvcke4lD7t+B23MQSG5LVnJQgskJwJicxP7bn9vd8NK5x6RrbftuUc/nzZ0CdNkVioHD5/OBrxfDrs4Pda6sL1DT9Q71JLx1J8XAoKqcVqK68Dhz12nxZ8zNRMumkeFbfbMRHKhN9U0NoI9lYDTgNDObwcRs6OOm34+H7Ps2uLCqIkvszQBvCM9KTc4A4zDbL02NZrn0FogWz+Y8UD0AfYivbO/JNQ4xLEF4e6U5fbfutqz9voeKYpCZdMJIB+Y50QhCFYgflTLfEZv7FEviSudFFLroaRsJ255yOWF1xO6EWhS7wGlJeVXGVjt0VQW5XpdAFgtHHxWVfdwyywTIb19b0x6BGgBIERYWu6zAJNsbIRf5fhKFRDA6JU6XNewydCqv3xdo4dHxva/5xIx/NRmRIHPAtZ8ZarD820cB9h8SLNf4iVX3TP2fhuAkgc1xfnyjzlJuZmXUx7HiNZESModvr5w7vxO0mnAvjvtXwDYzJ8FDaxaIXkLmZ728asu6Ow+2xj1rdpnkA21yCptLAdSWKw+PHpKJJMFZadep35Gy/sXuh1ENyFJFUFRucTYCgJIlOz3ZSr40eILYpmciig5kTBrzGkqajTdJzxhKLM29FG92JJid0/jmbNUU4FByTzlx0elRpdhn/TxnMWuaaUsbEfP+bzISgAj/yl135NKA/ECClYpIiK4sQvqkTvP9njOwCKP7h2KYl6JVRSzspErF2v8LOR+gpv6DLi09PJYMSDwJU/4gAewSJtF92XzWG3TNo2udnen7b/qiF06QU0nODmYNw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9fe044f5-141f-4b06-0ebb-08dc530a2361 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Apr 2024 11:43:38.9903 (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: AANPqXA3dyPekJ2VDHWb5CEODbr8vwetntlpna2yc7Vbu8RA8MPHWeXGFYPx9SFA9Q9AIBNIwaGf1vg+ffdSRA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9498 This adds bthost_set_pa_data. --- emulator/bthost.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++- emulator/bthost.h | 4 +++- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/emulator/bthost.c b/emulator/bthost.c index 8c40fce90..d710f4982 100644 --- a/emulator/bthost.c +++ b/emulator/bthost.c @@ -5,7 +5,7 @@ * * Copyright (C) 2011-2012 Intel Corporation * Copyright (C) 2004-2010 Marcel Holtmann - * Copyright 2023 NXP + * Copyright 2023-2024 NXP * * */ @@ -3127,6 +3127,52 @@ void bthost_set_pa_params(struct bthost *bthost) send_command(bthost, BT_HCI_CMD_LE_SET_PA_PARAMS, &cp, sizeof(cp)); } +static void set_pa_data(struct bthost *bthost, const uint8_t *data, + uint8_t len, uint8_t offset) +{ + struct bt_hci_cmd_le_set_pa_data *cp; + uint8_t buf[sizeof(*cp) + HCI_MAX_PER_AD_LENGTH]; + + cp = (void *)buf; + + memset(cp, 0, sizeof(*cp)); + memset(cp->data, 0, HCI_MAX_PER_AD_LENGTH); + + cp->handle = 1; + + if (len - offset > HCI_MAX_PER_AD_LENGTH) { + cp->data_len = HCI_MAX_PER_AD_LENGTH; + + if (!offset) + cp->operation = 0x01; + else + cp->operation = 0x00; + } else { + cp->data_len = len - offset; + + if (!offset) + cp->operation = 0x03; + else + cp->operation = 0x02; + } + + memcpy(cp->data, data + offset, cp->data_len); + + send_command(bthost, BT_HCI_CMD_LE_SET_PA_DATA, buf, + sizeof(*cp) + cp->data_len); + + if (cp->operation == 0x01 || cp->operation == 0x00) { + offset += cp->data_len; + set_pa_data(bthost, data, len, offset); + } +} + +void bthost_set_pa_data(struct bthost *bthost, const uint8_t *data, + uint8_t len) +{ + set_pa_data(bthost, data, len, 0); +} + void bthost_set_pa_enable(struct bthost *bthost, uint8_t enable) { struct bt_hci_cmd_le_set_pa_enable cp; diff --git a/emulator/bthost.h b/emulator/bthost.h index 46781365b..f03262d46 100644 --- a/emulator/bthost.h +++ b/emulator/bthost.h @@ -5,7 +5,7 @@ * * Copyright (C) 2011-2012 Intel Corporation * Copyright (C) 2004-2010 Marcel Holtmann - * Copyright 2023 NXP + * Copyright 2023-2024 NXP * * */ @@ -102,6 +102,8 @@ void bthost_set_ext_adv_data(struct bthost *bthost, const uint8_t *data, void bthost_set_ext_adv_params(struct bthost *bthost); void bthost_set_ext_adv_enable(struct bthost *bthost, uint8_t enable); void bthost_set_pa_params(struct bthost *bthost); +void bthost_set_pa_data(struct bthost *bthost, const uint8_t *data, + uint8_t len); void bthost_set_pa_enable(struct bthost *bthost, uint8_t enable); void bthost_create_big(struct bthost *bthost, uint8_t num_bis, uint8_t enc, const uint8_t *bcode); From patchwork Tue Apr 2 11:43: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: 13613787 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2092.outbound.protection.outlook.com [40.107.247.92]) (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 87E5467C46 for ; Tue, 2 Apr 2024 11:43:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.247.92 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712058227; cv=fail; b=EEVfBKRJ2IthtOAXVMjN53yJb+C+c/3xZXu11ZAveWCuLfs3qdWF7zTAopzQ9gujbKQzwMFg12WrsHIDkp2HaJquJZ0dScjhgw+7FNU2FQDqBhB1d32WLd2d89Xv1McknjJnR6im3WoWHzfKYllCDfiUwALnatgoXg2SPEtW0Uw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712058227; c=relaxed/simple; bh=vCR98MttEt42OxbDPUI6wxQ27gbVTiauNfDkljuaeP0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=MxAikrtoz8tC22/+KVmEVu8bXXpBj0zgjpQYZ/RvvLkc+05bUcbgATerrnCO7ZAVu5TGO+qDL83Id4cc6wXzPEsFCL9eg3Cj9/WMgR+NUY1SG8u4xMQk7QYVG/TUOaazMM+Z1yStebuKXFAUkBfRaJnHjY/AsM/SHfrroD4ujKE= 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=WVP8oCwq; arc=fail smtp.client-ip=40.107.247.92 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="WVP8oCwq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c2h9LJvj/hADgkqNbe78LPQe4cXhj+kk6EaJbgpDSR8lbxzp6tHO7n31wedAIYZWE+c3vHxAz5bisslPScKPX/t5R38hszFQb7b1QGivcpCrs/+96CslW7palvRVTuG7zujrAVDiHesBGVYEzmRsMCUP6ynnW37At5iX0szQqeB/3t/YQu8j+vI9PFXinmvUxHiXdmxm86336XhnFimMf8xaaRZtl8hS7z5FEoXRGsc3EN28kiwDYvNOcxyb9nqQ+ii40O4wPDs+AzkIF/6PJJmDBke2R3mmhmXgXjksLr9a3bTqeRTL39YrR1CUE6HPgF0A8Dm44/s0VGkok23iqg== 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=M+i8hAXMZgEjGG3OA3zVNSwriMWalUVbfMEzi+e+BmE=; b=lOf5ehqEf5EV+kJxznzW4pUtBnGBOgi0CC/uMbWzjoNOsyT3EJRo2nKbwlp7++U6yxO/6iW4GBloQiCpXJsmEa0Nxju2hvZmNViJzpFLZB0ufxwm4BZoSGOwM35Suc9Fv3RKEaiGJkTwfg5zTJi/nPEdEZaoitgz1E7fU6HUKplGyyrghpjdGtXBWsEA1DBFN4HAoWXzc2LrFVS6x4D+BbIIr6ncDcvUAGDmy4jfrWbJ0HglPgmNS+Iu/QZBjnmsMf9gdv5ATB+RqnK2838QXciaX0sw8EnYBpAHoTnM1pg46GNOQK5l8LO7ZpctrcdxywrCgKbnUiRIkgA+UtTBHQ== 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=M+i8hAXMZgEjGG3OA3zVNSwriMWalUVbfMEzi+e+BmE=; b=WVP8oCwqO02Fe68Jj7G5sdvbwS7E26rc65oZN+q43Z62LsBVybUOZ+Xlvn5lqGbhkCHinT4pK4INfoZ9Mq0tkNobtkmsTQ2nzyHKgB8I17cnv7N2+tgdB9ludVEXBLqZxMrms6PolqiHyEQUl65v13iMkRpKPmQRYABCmiH7XpA= Received: from AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) by DBAPR04MB7271.eurprd04.prod.outlook.com (2603:10a6:10:1a6::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Tue, 2 Apr 2024 11:43:42 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::c65:a818:c6c3:679f]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::c65:a818:c6c3:679f%7]) with mapi id 15.20.7409.042; Tue, 2 Apr 2024 11:43: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 3/3] iso-tester: Add test for Broadcast Receiver Get BASE Date: Tue, 2 Apr 2024 14:43:26 +0300 Message-Id: <20240402114326.3330-4-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240402114326.3330-1-iulia.tanasescu@nxp.com> References: <20240402114326.3330-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: VI1P190CA0012.EURP190.PROD.OUTLOOK.COM (2603:10a6:802:2b::25) 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_|DBAPR04MB7271:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W9ceR1rseNFeEGVIfbpmyc4Ho+207RybnF2WSr7+ZwuH8Wuyst9axiM2rqECGHUMWr16Dr/ChOmyUlb0QvA2/GNFfcDLIVMQiGr0mvb3lUWu1CbOIDdZCd/D7IKGG6ZDlveJ723mjyeMXX73fFAMFdWYYMp47+f1+SK/pohSxCceU1Pegw5QYtcFFbjXPhjBwQLqHcSHBTIbb19aP5iUGnaubiLEThWeqBx4QQ49tpJ7u7HXpBdLiBQqmGitUC5kEHdJCSQ+D72T21P1ENgZ5OwKmjPMWKxp4GA1ZtnDCUeIeXSlMr25UQg40kcW/qJCEbOjnjDprVSqjU2kJFZ74K5tMSNknim0arzvM9A4qyaAjq89dUJqzOdBQDCsQrrnSjCjTrZw7FAN7AdGrbVxT2yRF2gQ59f4I89G+TOP6kthbcnzu39sfSekA+EgNuKRlgd+pgXl+L3OfTcfKZajkJlgxhBSgKNIG1lMNU7NCq+xNtWyDnK0T1X/xyCSpakVrrtjLienfR/zicz8CU/LWK3P0+waq1TIHdBi6eJ2Oq8FSULePHv/bxGLElPs95HUU8SOLJw/ihRkvS7sd+aWzHB8uS+p4YV8zHldqbW3L+l8hezGz8rYdfnZWnTzZl9xlzmAW9yiDHxqqyjwVY5VhncOPIq2fCk5JRgig1RJomw= 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)(376005)(1800799015)(366007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: T0ops0xvYlDyITdBMZy3ZSwXECj0ICec3h1cDmTwUmC542sLG1Kww+8RVrzs9rNvsWG2TOKUNlNQ4KZz1h+wPepuZJf94aGcdwEOXnqCZDo+pRI3rnM0AaGP3Ypv45WS4XYmZc7TCfwVajF1kKEDxo++DHD5Ht3HSvwfleaE9gJuHxt9X7ZvyBTy5niNTGNDpGqqHFnDjAFA5BBbsGBaLHgwxpJTVprtblDUt6K2RGLAdHFGHzcEJB9cDgVi3UMvFmUqIGH70iteUdxcVU93XBlY+Jcos0oB2kJgE+qYOROZ1YvnGfHkSfCZhD+wBJS5rqux/eJXccLy37ndSreTnZpd9FFy3S7ZGYeDUtJMn4/tdRsiz9znUb0KFP77ckXT2mmByh2Pwy30zY2shJ2wswPg/zkRHqKl9Z1eP4j072EzaPHuwPKTIK2EMzluEzMFY3s+ZS+Tmz7cSa3galU0PU55uGKdX+R6RZEfkASk4kvSuB5UiZIC6/SAZo9iEShrVpR+bzJMzPBsk5cE0AiQX85qKsNP79MqoZhwRT2LYLxJ/8/AO8wvRA9nvIVCUs698qBKE/qI6rL5aPIPa4fSk6xi9U3MnjxKpgQ4eOmRTMCqnbW5n68poZQ8lWZws/8QKUTxQrf0mU1z4Ej18nZXnd5xzmbJToNc3tz9QuxHKjNWWPYTftEsOfPSCXTTq7+WwiltPe/WVWindIKNqELFQJXOCPjE1lXFXeGPWgjsOKAVXT3FhF3QyUTy5W+lWoOLCn9EpPTBcmu/A8Abj8U8u5obiC7jyHkiWkLIll3rDEsRURq0rMJZk+HqhuoF0W0pCBh3lytgTtG9AsB3t23SOoSR761Kc/piKgSw9EEyxszbRL6N2OE+BcMGzCB6SaE86F39nEqeScPC/jM5kehwHX4GNXgxVe4ambHltVGnTBcXwNr+fmQ6NvJLe7B2xqMLpweIdW9PcGCtSdFxBvXHbMmPAHDbN/SBPso6shrDfBu6kO8UT0Z+P9FzoLZevr9dQl5pcGT/yqG9Az/i9t9gKCfHdvvhDtwqCh0Uj5NZhdpUqWTtPW5vCZhVa91O8LG962gYnfIwCtohvFR6fes/h3DbQkA6KTJIo+gGCK/AUYkwXMpmzKmZlifkPaFPIlWScyt/liI7fUISQFO6AjPR+c1jAjhJowf1qO6tLpEqWVxt71tGiMv6TcBeo9qIKNJx1u2x3qRtUyRcqzA88J9l3YG/gqshg41vLJyiLKrTI5kdlwgz5tLXkal8ZMhO49UxpJf4BJx2Sx51KvMNbhlf10f3sswWWf6tORpzZLqYad8YPP/+Es+22IzUACAwt0IAsZ5HaCH3yVa294uRhIDUNSekQ79q3txBRyK1AIo6KQKJRVHmUIM5EptO+obC/AhruYW5g0Fz4GBeIJAv7w2+SfAIH8lTA4PaoQbs6XzhrF15EbQlGsGCcYR9oWh8MYwRFpdLtgzUXukgzl4gSQqrFUqPEYaqqmzB60USQjjCkO2B2EPIkhxAfKskmvuHkS/Z+j2G6pRIp2ILBuKxoqI84UyCTWvBGTqfT5C5iIlnDoD90QzhvG3IBmePsz/NT63Pl+lQynPTTK33zGkRZp6/Kg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3e3ff491-8f95-4acc-82f8-08dc530a2539 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Apr 2024 11:43:42.0657 (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: Ja9RCyR/LeWNFxwgImXOzU2d2wdOkdpFrBCiwanjmFI14+tDDSlFp+zHcFlcLmOuRH+4dGKKzM+O3bKA6LrLvA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7271 This adds a new Broadcast Receiver test, to validate that a Broadcast Sink is able to sync to the PA transmitted by a Source (when no BIG is active) and is able to successfully detect the BASE: ISO Broadcaster Receiver Defer Get BASE - Success --- tools/iso-tester.c | 70 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 3 deletions(-) diff --git a/tools/iso-tester.c b/tools/iso-tester.c index 60afef301..67d698291 100644 --- a/tools/iso-tester.c +++ b/tools/iso-tester.c @@ -23,6 +23,7 @@ #include "lib/bluetooth.h" #include "lib/iso.h" #include "lib/mgmt.h" +#include "lib/uuid.h" #include "monitor/bt.h" #include "emulator/vhci.h" @@ -34,6 +35,8 @@ #include "src/shared/util.h" #include "src/shared/queue.h" +#define EIR_SERVICE_DATA_16 0x16 + #define QOS_IO(_interval, _latency, _sdu, _phy, _rtn) \ { \ .interval = _interval, \ @@ -487,6 +490,7 @@ struct iso_client_data { size_t base_len; bool listen_bind; bool pa_bind; + bool big; }; typedef bool (*iso_defer_accept_t)(struct test_data *data, GIOChannel *io); @@ -1301,6 +1305,7 @@ static const struct iso_client_data bcast_16_2_1_recv = { .recv = &send_16_2_1, .bcast = true, .server = true, + .big = true, }; static const struct iso_client_data bcast_enc_16_2_1_recv = { @@ -1309,6 +1314,7 @@ static const struct iso_client_data bcast_enc_16_2_1_recv = { .recv = &send_16_2_1, .bcast = true, .server = true, + .big = true, }; static const struct iso_client_data bcast_16_2_1_recv_defer = { @@ -1319,6 +1325,7 @@ static const struct iso_client_data bcast_16_2_1_recv_defer = { .bcast = true, .server = true, .listen_bind = true, + .big = true, }; static const struct iso_client_data bcast_16_2_1_recv_defer_no_bis = { @@ -1327,6 +1334,7 @@ static const struct iso_client_data bcast_16_2_1_recv_defer_no_bis = { .defer = true, .bcast = true, .server = true, + .big = true, }; static const struct iso_client_data bcast_16_2_1_recv_defer_pa_bind = { @@ -1336,6 +1344,17 @@ static const struct iso_client_data bcast_16_2_1_recv_defer_pa_bind = { .bcast = true, .server = true, .pa_bind = true, + .big = true, +}; + +static const struct iso_client_data bcast_16_2_1_recv_defer_get_base = { + .qos = QOS_IN_16_2_1, + .expect_err = 0, + .defer = true, + .bcast = true, + .server = true, + .base = base_lc3_ac_12, + .base_len = sizeof(base_lc3_ac_12), }; static const struct iso_client_data bcast_ac_12 = { @@ -1498,9 +1517,28 @@ static void setup_powered_callback(uint8_t status, uint16_t length, if (isodata->bcast) { bthost_set_pa_params(host); bthost_set_pa_enable(host, 0x01); - bthost_create_big(host, 1, - isodata->qos.bcast.encryption, - isodata->qos.bcast.bcode); + + if (isodata->base) { + uint8_t eir[HCI_MAX_PER_AD_LENGTH] = {0}; + uint16_t eir_len = 0; + + eir[eir_len++] = EIR_SERVICE_DATA_LENGTH - 1 + + isodata->base_len; + eir[eir_len++] = EIR_SERVICE_DATA_16; + put_le16(BAA_SERVICE, &eir[eir_len]); + eir_len += 2; + memcpy(&eir[eir_len], isodata->base, + isodata->base_len); + eir_len += isodata->base_len; + + bthost_set_pa_data(host, eir, eir_len); + } + + if (isodata->big) + bthost_create_big(host, 1, + isodata->qos.bcast.encryption, + isodata->qos.bcast.bcode); + } else if (!isodata->send && isodata->recv) { const uint8_t *bdaddr; @@ -2183,6 +2221,7 @@ static gboolean iso_connect(GIOChannel *io, GIOCondition cond, socklen_t len; struct bt_iso_qos qos; bool ret = true; + uint8_t base[BASE_MAX_LENGTH] = {0}; sk = g_io_channel_unix_get_fd(io); @@ -2211,6 +2250,27 @@ static gboolean iso_connect(GIOChannel *io, GIOCondition cond, return FALSE; } + if (isodata->bcast && isodata->server && isodata->base) { + len = BASE_MAX_LENGTH; + + if (getsockopt(sk, SOL_BLUETOOTH, BT_ISO_BASE, + base, &len) < 0) { + tester_warn("Can't get socket option : %s (%d)", + strerror(errno), errno); + data->step = 0; + tester_test_failed(); + return FALSE; + } + + if (len != isodata->base_len || + memcmp(base, isodata->base, len)) { + tester_warn("Unexpected BASE"); + data->step = 0; + tester_test_failed(); + return FALSE; + } + } + len = sizeof(sk_err); if (getsockopt(sk, SOL_SOCKET, SO_ERROR, &sk_err, &len) < 0) @@ -3383,6 +3443,10 @@ int main(int argc, char *argv[]) &bcast_16_2_1_recv_defer_pa_bind, setup_powered, test_bcast_recv_defer); + test_iso("ISO Broadcaster Receiver Defer Get BASE - Success", + &bcast_16_2_1_recv_defer_get_base, + setup_powered, + test_bcast_recv); test_iso("ISO Broadcaster AC 12 - Success", &bcast_ac_12, setup_powered, test_bcast);