From patchwork Thu Aug 29 13:25:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13783245 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2044.outbound.protection.outlook.com [40.107.104.44]) (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 272FA1AB53E for ; Thu, 29 Aug 2024 13:25:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.104.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724937926; cv=fail; b=NgndMxfzTSMpJX164Fz+F98OqJeiDt+M3TXS98qrgwXzz1AZiOH0dI5tq1znsb3eehUppAOyU0C2JOU7FIaM7mxLb5TW4G0W9WomIuO/gJ3nlkx+4+G41EXa3smZElsPNgyxYsPS/sPde3E+8PXEjhqh+lON1fwAfMWKu0Jio2M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724937926; c=relaxed/simple; bh=vzcXiqsU+vTi4T4eYmvv57vuHJytrPz0x+S75rlspjE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=h30/bkuwsE0d/GB2yb2XlCGyvyHuIcPcPYgEpYK3H72s9ki9d/M7nvqYaAQEulEu37vq+a1XQFjwXbpBnFMhx+oZKnhI/WF76EYt+bRydI1I+dEfLtWkB1DHZwu38UEFvahThB0wSGucRmNjfSX/a1ZKmRt01dxBBG+kin/7/qI= 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=bXMv+Y/h; arc=fail smtp.client-ip=40.107.104.44 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="bXMv+Y/h" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hnjkCHAspmp/+LocL4i2bJuzRB5pXKqCcthHNH2Z+BK5jbZ5QauByLgNDgkh+IJtfQt17hJYT9Q2ri0tsCQ1/2Bw23QuFVCQglbMURj6iomIA0SK2UTpSYwJE+3TPw9xqTY+nlaCeS1OrET7KQY9SC+0ZGF6vvIjxlgIbIeCek/9xjEY3QSo6cALPvwxTh/4JXbzWmYU0Bdh0A4rYL3jc0P3fLacA7klwgD2C3DUyFWKjbMViCPgNqZkpZlTIvLRAWozdS6MZeubtzKOvXlmar7r+AkhW0GKd1kafmhiEvi9RDYEbJ2s5uGrWRWLYnSZ5/qfb92l9Hwnu3YY8APzxw== 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=HCeCLYsLifOStSe+GzvVE1Rm6IV/nV2c2K4pzg2w420=; b=JvsH6JV9zbUkjK7Amk0hPJ49VhvLBE9mZjDbNat8xjisNPu6Q3JHJWlngrku5Juyaw2rFkXS+v0CFpsgzF77QPhT620w3bdUFBxsqEvulpjTD8Y6Aa7TkG/RtmjtXmXhmuF6Edz6Y+Oo7gzl/jK7Jg6kLgjJWtzKkI3G1sP+WSCeb2c8/45tgUClIIa10yW187DwWQ3k8QS+KtrvAMiYUCT+2hqn4dlL5spiPhDNnLPcqAU0bHpbeQKYz2uzDRXEd6i0wmmcIG7yoQzniK/IKw3JDaktZNCfg3jovmO0jhIBA7I3ojXa96PrGj4227mjdxyXpWGAzCEbocY0HNmbXQ== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HCeCLYsLifOStSe+GzvVE1Rm6IV/nV2c2K4pzg2w420=; b=bXMv+Y/hBrp/9A1sMuxZsa7Cy0VRHGyFX+ARsFnu7+ne5kERJEjaLNYjNqd1bkDRzOj/uPq9b4nHCoOT+GV91AzoaNVQ3AZk4sONXzj0bkRNhbuVKgy7cL4o6DREjb7Je5Rf6slH+WU3D9IPjB8KI8vGiYPMBcsQyOb0pPPQGxz4817oczRG7Lo4LCyYwkvTYLTsKh5TBO00g2lhmAPSWcaFiBzvOLVC/R3iIyEyGZ+vmktb54McorMp0L5XZ/mBfheyPqNWOUgoai3UOqy39rzKFdRLkYQ0cIF8tvTErdE3l1PMJr2lpLmPhUgWvs+rC2sz2vdXhn2sQ8C3tNFzXA== 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 AS4PR04MB9385.eurprd04.prod.outlook.com (2603:10a6:20b:4e8::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Thu, 29 Aug 2024 13:25:18 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654%5]) with mapi id 15.20.7897.027; Thu, 29 Aug 2024 13:25:18 +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 1/2] client/assistant: Enter Broadcast Code as string Date: Thu, 29 Aug 2024 16:25:06 +0300 Message-Id: <20240829132507.4545-2-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240829132507.4545-1-iulia.tanasescu@nxp.com> References: <20240829132507.4545-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AM0PR02CA0181.eurprd02.prod.outlook.com (2603:10a6:20b:28e::18) 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_|AS4PR04MB9385:EE_ X-MS-Office365-Filtering-Correlation-Id: 0da19dd2-4d18-4c9e-82f6-08dcc82e065a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: ATgno3CIwQyOW1iYcsxKycdojxnRLi8nJQQXPiQSAN4vsHqiEOPP0XVomTLhcK9OWlCYJbj5mP6AZeJ0mZEc3Cuscsft3Uh/o5/+gl6SL6IKYHIcfKnuNNApABK1DkiiltLaLb/Wrw6A0+7LDT6/C2sjZDIyGPtaRXIy3XI+a/QtKdAEBIiCEHcfVwNzAQSLqLO0e1vEe3iwKZ11Afsv5kh0kprLYygKeiMf8wTddTHmapx7z/+F98/N1iwXD1uA5Pr2KiSu0fIqQ719wY04JZtIBBlNBiOU3RYhoAhKltcABspEeRd5Dg1EbecAwBh1LZwFG2WG4LhsJ961z3c+B6pwCxd6LM79GpF8x7x6cCjMAUmHUhCzXEzMex+wj54M9fBCwVmf8uKCWfMv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YYhp4/frxEGbhCpik3Gjj0Bw6UuPNfdHeG2gQzXxMt65DQ4fvYGQlGnqb4HQWI4Z4Gd8Dd+Cwqbn96xj96DGxEEg01ls38Y1iqv7bwr0IV5R9Xvo5qo/NBC8OTJtxcHzhOHy1rru0nbTjhlmt2LBCIQFDJF4GGn7gTZBH7JiyF6C13huPnqoU8OMnbTU0TrzdJmTEDqTg220G9Vd3wqK+kM0dEj++Q93DyOOKulTFkTE9g4TYS2heVXLYRwY45W2ZAQ7T0PE8HsX4ZaVQgUUcmyzeFDQ9adCUZubhgTeuJKQ/sAXiCGb26IGhNYCIPcydJ79hB2jdbFhBIzrIcdHBYQNKK0yhrzlUHfBMGGSzkS3viNdxWZGxr7+BPT/B/kEwLTtdD2C0vMPKfCejI1SaTzcLv6/44EtdK9L/2wyRMA4NFOkSKlcDuEczLE8wWgq1kuXzzoe/+kvW+4r6c4IITmojYzrqVtU639TgzPOD3phFAuxjSvQPV7+NQSnb1H2JIE2s+c/BE5P10GY2uReIHMUoyh/GaN5SIJj1zxkFXPofsMD9EMtgLVGQDS5JBVwH7mh1cUV4xaQDJArmDUoxoz1obEqX1MEFOY3sHv8EsaEZW+kMuKOuUavb5cnqUgGhob0d2bvy3PuBPFJL2w== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0da19dd2-4d18-4c9e-82f6-08dcc82e065a X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 13:25:18.6035 (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: EWiwUDUxtKrgbV3IFUKNyQfxrIZFnzTXWi6cqJHF7ksUeiFDGtYcS6lLYCKiU7dmguKEo9x5MMoJHhJKDcb5pQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9385 Currently, the user sets the Broadcast Code as an array of bytes when prompted from the assistant submenu. However, the Bluetooth Core Specification requires that, on the UI level, the Broadcast Code shall be represented as a string (Vol 3, Part C, 3.2.6). This commit makes the Broadcast Code be parsed as a string from the assistant prompt. The bluetoothctl log below shows a Broadcast Assistant pushing an encrypted stream to a peer: client/bluetoothctl [bluetooth]# [CHG] Controller 00:60:37:31:7E:3F Pairable: yes [bluetooth]# AdvertisementMonitor path registered [bluetooth]# scan on [bluetooth]# [NEW] Device 00:60:37:31:7E:3F 00-60-37-31-7E-3F [bluetooth]# connect 00:60:37:31:7E:3F Attempting to connect to 00:60:37:31:7E:3F [CHG] Device 00:60:37:31:7E:3F Connected: yes [00-60-37-31-7E-3F]# Connection successful [00-60-37-31-7E-3F]# [NEW] Device 19:9A:7A:71:E5:8B 19-9A-7A-71-E5-8B [00-60-37-31-7E-3F]# [NEW] Assistant /org/bluez/hci0/src_19_9A_7A_71_E5_8B/dev_00_60_37_31_7E_3F/bis1 [00-60-37-31-7E-3F]# assistant.push /org/bluez/hci0/src_19_9A_7A_71_E5_8B/dev_00_60_37_31_7E_3F/bis1 [Assistant] Enter Metadata (auto/value): a [Assistant] Enter Broadcast Code (auto/value): Borne House [00-60-37-31-7E-3F]# [CHG] Assistant /org/bluez/hci0/src_19_9A_7A_71_E5_8B/dev_00_60_37_31_7E_3F/bis1 State: pending [00-60-37-31-7E-3F]# Assistant /org/bluez/hci0/src_19_9A_7A_71_E5_8B/dev_00_60_37_31_7E_3F/bis1 pushed [00-60-37-31-7E-3F]# [CHG] Assistant /org/bluez/hci0/src_19_9A_7A_71_E5_8B/dev_00_60_37_31_7E_3F/bis1 State: requesting [00-60-37-31-7E-3F]# [CHG] Assistant /org/bluez/hci0/src_19_9A_7A_71_E5_8B/dev_00_60_37_31_7E_3F/bis1 State: active The btmon log below shows the way the Broadcast Code string is converted into a byte array and sent to the peer via GATT: bluetoothd[6013]: < ACL Data TX: Handle 0 flags 0x00 dlen 28 ATT: Write Command (0x52) len 23 Handle: 0x0040 Type: Broadcast Audio Scan Control Point (0x2bc7) Data[21]: 02018be5717a9a1900db5e3a02ffff010100000000 Opcode: Add Source (0x02) Source_Address_Type: 1 Source_Address: 19:9A:7A:71:E5:8B Source_Adv_SID: 0 Broadcast_ID: 0x3a5edb PA_Sync_State: Synchronize to PA - PAST not available PA_Interval: 0xffff Num_Subgroups: 1 Subgroup #0: BIS_Sync State: 0x00000001 > ACL Data RX: Handle 0 flags 0x01 dlen 2 ATT: Handle Multiple Value Notification (0x23) len 24 Length: 0x0014 Handle: 0x003a Type: Broadcast Receive State (0x2bc8) Data[20]: 01018be5717a9a1900db5e3a0201010000000000 Source_ID: 1 Source_Address_Type: 1 Source_Address: 19:9A:7A:71:E5:8B Source_Adv_SID: 0 Broadcast_ID: 0x3a5edb PA_Sync_State: Synchronized to PA BIG_Encryption: Broadcast_Code required Num_Subgroups: 1 Subgroup #0: BIS_Sync State: 0x00000000 bluetoothd[6013]: < ACL Data TX: Handle 0 flags 0x00 dlen 25 ATT: Write Command (0x52) len 20 Handle: 0x0040 Type: Broadcast Audio Scan Control Point (0x2bc7) Data[18]: 040142c3b8726e6520486f75736500000000 Opcode: Set Broadcast_Code (0x04) Source_ID: 1 Broadcast_Code[16]: 426f726e6520486f7573650000000000 > ACL Data RX: Handle 0 flags 0x01 dlen 2 ATT: Handle Multiple Value Notification (0x23) len 24 Length: 0x0014 Handle: 0x003a Type: Broadcast Receive State (0x2bc8) Data[20]: 01018be5717a9a1900db5e3a0202010100000000 Source_ID: 1 Source_Address_Type: 1 Source_Address: 19:9A:7A:71:E5:8B Source_Adv_SID: 0 Broadcast_ID: 0x3a5edb PA_Sync_State: Synchronized to PA BIG_Encryption: Decrypting Num_Subgroups: 1 Subgroup #0: BIS_Sync State: 0x00000001 --- client/assistant.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/client/assistant.c b/client/assistant.c index 77fb78329..16e94664a 100644 --- a/client/assistant.c +++ b/client/assistant.c @@ -255,28 +255,32 @@ static void push_reply(DBusMessage *message, void *user_data) static void assistant_set_bcode_cfg(const char *input, void *user_data) { struct assistant_config *cfg = user_data; - char *endptr; - uint8_t *bcode = cfg->qos.bcast.bcode; if (!strcasecmp(input, "a") || !strcasecmp(input, "auto")) { - memset(bcode, 0, BCODE_LEN); + memset(cfg->qos.bcast.bcode, 0, BCODE_LEN); } else { - bcode[0] = strtol(input, &endptr, 16); + if (strlen(input) > BCODE_LEN) { + bt_shell_printf("Input string too long %s\n", input); + goto fail; + } - for (uint8_t i = 1; i < BCODE_LEN; i++) - bcode[i] = strtol(endptr, &endptr, 16); + memcpy(cfg->qos.bcast.bcode, input, strlen(input)); } if (!g_dbus_proxy_method_call(cfg->proxy, "Push", push_setup, push_reply, cfg, NULL)) { bt_shell_printf("Failed to push assistant\n"); + goto fail; + } - free(cfg->meta); - g_free(cfg); + return; - return bt_shell_noninteractive_quit(EXIT_FAILURE); - } +fail: + free(cfg->meta); + g_free(cfg); + + return bt_shell_noninteractive_quit(EXIT_FAILURE); } static void assistant_set_metadata_cfg(const char *input, void *user_data) From patchwork Thu Aug 29 13:25:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13783246 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2044.outbound.protection.outlook.com [40.107.104.44]) (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 5BEDC1ABEAD for ; Thu, 29 Aug 2024 13:25:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.104.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724937928; cv=fail; b=hc20YGAFYVDM+F+8PURBuOLMPu2dnz4AUidY1Nkb1T4QzWdPBs4Y6214x2arVjgTx6bO5iK6pYGd6DqYQgJxv90Dia3xuumkJr4OyOmD+RAd7caS6Af1+QNL66UgKEF6nshYfq/v+FoI6wxzZ/jv8GVPEfoEyJIKb22hdCUgzv4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724937928; c=relaxed/simple; bh=JDi0E2AoY6qOabO4Kf694/K3CkpWi4m2c3WOG1emJOA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=QFJjS5JDDzUfD64cec+FWJC9m5o70wj2oJ+siFn8Zr3iSkg3NH3Rq9QRhua03ShhqqVhrEERgd/ApcBDuk8ufEu8ZPgiuKF9b/d0GvW0tqThiCE1y+LUjX5HLqzr1rRArFoRhxbOwPMg200BAndW0b94OWA1M3q7ynLAwDYSRbA= 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=ALX9136Q; arc=fail smtp.client-ip=40.107.104.44 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="ALX9136Q" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JrzePfFE/URChSZCBRP4o3xIPgTnlQI+YYAGFky7aUsC+WOI/E0dF1GE1jzI3GJmcp4EGuWAHbp0T2W4dBJghj8VvlaSNiE8buBvEXcej5EFfxZnHudFVGid+ZdepZniskwUopO3MDbEbHM5Vb2fDXYGhVQsQjTPjklhNcaWplO8LOYkmNcsyLTOWmiwyrmmgrp4ALI1lkWbkScc+ykfoLtQ8s3/mQJVoKpjAZQ+DRsz86Tbof0lk59pnBQ2osCT639/uyBdm8KFunfL9IAmUPibc2VzxV68B11GdMKvoqH+t1QmLwNr5sXUS5LJq8LLgi6gGhEGMyGs46QLzw5+zQ== 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=D2uMz9ubI4zLD2/THMWsuoEGoJNSSH4xaMBwXPVUaVg=; b=XDaJriUiNmUJL5I9Ko/Ee04YXyq+ybVzTA3o9YCmRLwtwox9IHHEQDH9xsE2VhEDI42HDcIRE5vMUFdxGiyrOdyPDiYxcX1loeNKntGZl7YXZ15cUzHzbTPRh3d4Sa989c5GdYXJScseWJRdqegqpCTHlkE+aPhX2o+eSV0F9MN/t/H0B39dgwrXqR3M5LsIP5fvaZGw9azvw5cBYmfNYZxsG1qY/9M3zQQV/+e85AV1Qn1i/xt66v0u/82ELiVt2072ruQMALdTNkI82vpEA6qP8hv4py+RN23RWicqEBJFQ5ZuV9J/0WX1hMWnL8VSbcIg1eLvHZkQvtmZLcYAVg== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=D2uMz9ubI4zLD2/THMWsuoEGoJNSSH4xaMBwXPVUaVg=; b=ALX9136Q963e2VQwieAjg8m08LDqOjb6IqVYD2G1PgrD9KCjfkwDbAijBj19kZ5zdKsblbSOttjX6paepBIoq1igiTvgXOFkeL+v7ouV63mFr24iYJaabEPOPjJTcYoFSlP5qDRjkLQG0s2WBIKRj+fu34RROBpjYn3imQurwxdbQ8fQ3OzGgYR4hPjLRLhSyTZ6wUm+bG9nI6hMNCIDjP1OhiTkq8xRSy8+OmGQ2rWv4wkNZVJByYtWSoE6+jEXQO1K4TVhKUqTzQL7CsY7aif7dgArYEJvhwr5vcAwcL1Ngbf2r+a5qLOozWwvdud3Mujjf4Q/Tz8XQ2ArM2/0Vg== 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 AS4PR04MB9385.eurprd04.prod.outlook.com (2603:10a6:20b:4e8::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Thu, 29 Aug 2024 13:25:21 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654%5]) with mapi id 15.20.7897.027; Thu, 29 Aug 2024 13:25:21 +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 2/2] bluetoothctl-assistant.1: Update push command example Date: Thu, 29 Aug 2024 16:25:07 +0300 Message-Id: <20240829132507.4545-3-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240829132507.4545-1-iulia.tanasescu@nxp.com> References: <20240829132507.4545-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AM0P190CA0013.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::23) 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_|AS4PR04MB9385:EE_ X-MS-Office365-Filtering-Correlation-Id: 6fa69e6f-483b-44da-d987-08dcc82e085f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: XQeyOBft/+ob10QpQSuwOlX7eXtPWBqGDGOonyE1pcECotvBP3Z/XDbgh08rCQnFNLNIfI5YxqJRxzKL2vc9rPmQYniNxi6wzi7YXh69q+MFScOwHFVHpj/SlB8XV/ZvAX8MxkxNOP4OzFqz2ekO/F0NWgm408xGM4UHMk5OYSajazNv/sQBhpCu7WwI+E6J/Uczuefq0qNQHKGNJ9olBk55T43jcOCxcJGvgl1BcR+spnaRdh8043zQphXHz++QnLvDpCpCTYFUNmTxu8cmiejBBNjIz4PEVUISSLJ4a5U5+XWlKiyF+gIIlxBaLuvzF4/MZRQXdXQxdb/RnxJDws4zF+blUY+9PywuhtboNmVp9NPL1w5pVRAbZhQioWvU8twSedEQacHTV5ERt98NWtO0CG/aLY5Bbj7UfOaCMb/QvpkPDj09MCD0JxweGBNvGtALwZ2kENOTpTtojWOkokOjPUT2HnDV90xFssXjyuQpta8AxqbBhWHANWtanuBzXfoGVRyVBY3ABv2cc34frgdZ1mrhh5izzFL4ad2wNTGGodgIj/XekRsTqPLj2xeY1obo5T4DQMuJzq9thLXV2D0o3PA+TEyfyI2wzreTqaM+VrhNC5IkLjHF7oQNt0LrPvVgN9jxtJXxPBQPj0ZyZW80FRaIeWSTcP3KCkB0ntgtnZnlCogVtm3KkZFjzZxASlXy93jqxIFCtNC/JISixhG80JA/Wr1ArSPdu1LgXPhvb/dZAupO6Yi7JaFF7gfaGpnm2eJz5PvyXXfu+CPsT+q93EbjvwG67/avuu96cN3Wsz3VxreiheRaEZZVkJbYi5nK334m+mdd4vCxhkpvKE4s8sZJBLbGp7bj6rw9ITgIZdLyPSpnuSMmsj/9XawNKKq371PRbBf81db+eBzF9tW6jzxtNTe5Gt8jWPbClNxpkR9HWWUY+93E5JJPcJJVOCx0SGlVI1U4rah+5lYAU3kcFJIVyWRVYVq3lk+47dwbB0JrGz/j+Bg/3HDqkDUTh1/Dn/MGZ48mMeNh1Hzhdwkkz+vdpyFRIO301r4qYt6vtgdUA9Zyl4AdoEmbxTjTtv75zuoJ5qtiVKOdSjmMiozSgazbEYxJbczT7SfK2EcpjEoHH/1ZuU1hTsS5R+sbiRGjQTP5hrB3x/Qm6SlIPuISpupnWJh2w4uI5VjQHSf8vL/iUAR3+mrC56ws2w5YqQc4sGRGy+2pyj2TLakT4OLLfP6zdJtylYqCeSZTJZXrNTKj0fn0Sqj8iptLgG5FacjNfgUzapk6LM/jnNecKaB0Q26mEXC8RdntgGzVvZ0Zi33iFVU42JbAA0TATWaqnCAbl2h/pSjIzep+adJMcw== 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)(366016)(1800799024)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ropHdg/fyVBt6KW9mjJ/bQE2Ub8GFJakdCqn/fIGLSG6EeJiOLT1kNLYRGDGvVSDl0Ejtp2FDo5yN1CaU2G/dqgr7/LpsT3wOfgYAfYvFN6xzuqUPLoUe+xKB3NcgNK7+IKGV9wikwCVESvCx7eWK0jESuo0QVzyW+To2/lcJzp0uDo2QOmQjf0I/BNgcqAfa6cQZzUyaI1NEtUdzP0pIjmaj1dj8pKaPB8AvXR3v8QGuHS/GP2cnyh1wmL8kSrjg8ApDYkFBZiTRqVF5ocG7UjkAtvm0Ji6gK37gNTEXo5C37DHMpotxq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VXpuFgCzJr67kCFTmpZxHQ4ipjGMivwCvAsbTzST+jYwcrpfcF4h/zoP9RWaXI9LjqL9w/k0Agu1HvB1+TY+cxHEFJLhOQvSBr2CtRwUF1wSHR4OXwx9oLuIM0eYnQyeizG0maKitthH9EkgF5Xb2ZhAvO5Rivs+CMs6GvFDp+0K7LuE6Aj9b0wVPOrjSoVKzBP+LZM+bFrybXjrCpLsr7odyVVwBWy9914vwDkSqQ2BGwN6pWkn6RVweQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6fa69e6f-483b-44da-d987-08dcc82e085f X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 13:25:21.5385 (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: 1DBV4alNamwwcVZ1jjwwB/qOelr4C6VgVDqHwmeFe6/esxzYSEYyMQ4umI8rZjIM7G00a7hL+cxJ3LMoSBpUvg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9385 This updates the push command example to enter the Broadcast Code, since it should be entered as a string instead of a byte array. --- client/bluetoothctl-assistant.rst | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/client/bluetoothctl-assistant.rst b/client/bluetoothctl-assistant.rst index b4f7d039b..fb8c3a0d8 100644 --- a/client/bluetoothctl-assistant.rst +++ b/client/bluetoothctl-assistant.rst @@ -41,16 +41,20 @@ the default metadata will be overwritten by the LTVs entered by the user. If the stream is encrypted, the user will also be prompted -to enter the Broadcast Code. This is a 16 bytes array which -will be used by the peer to decrypt the stream. If the auto -value is chosen, a zero filled array will be sent to the peer. -Otherwise, the bytes entered by the user will be sent. +to enter the Broadcast Code. This is the key to decrypt the +stream. On the UI level, the Broadcast Code shall be represented +as a string of at least 4 octets, and no more than 16 octets +when represented in UTF-8. The string will be sent to the peer +via GATT as an array of 16 octets. + +If the auto value is chosen when prompted for the Broadcast +Code, a zero filled array will be sent to the peer. Otherwise, +the string entered by the user will be sent as an array of bytes. :Usage: **# push ** :Example: | **# push /org/bluez/hci0/src_05_1F_EE_F3_F8_7D/dev_00_60_37_31_7E_3F/bis1** | **[Assistant] Enter Metadata (auto/value): 0x03 0x02 0x04 0x00** - | **[Assistant] Enter Broadcast Code (auto/value): 0x01 0x02 0x68 0x05 0x53 - 0xf1 0x41 0x5a 0xa2 0x65 0xbb 0xaf 0xc6 0xea 0x03 0xb8** + | **[Assistant] Enter Broadcast Code (auto/value): Borne House** RESOURCES =========