From patchwork Thu Mar 7 15:58:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 778632 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2069.outbound.protection.outlook.com [40.107.22.69]) (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 C835212F379 for ; Thu, 7 Mar 2024 15:59:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.69 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709827149; cv=fail; b=fjKxhQN1N7l93GuZ2OoR11RJy1gilPgwwQ1z6U44BFy+J1g0+j7BY5WTxQDg2R2pabrXbKyEkcDu7WWw/uK/NR2VbCYWV9yYbnlUI8z0FduSTa/gJbOId+yqWm6+A3H8g90LomDbE59gKeVskxxkwntjkOe7S/03v00s1iEr0EM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709827149; c=relaxed/simple; bh=PXru5G2NI7QN61hxDRjr64v5d//1qjJxkCZ9Jk7pzaM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=cz/wc1U4qfDei6l7z7QKSahm0S3QXX5NF349rxjgq4lnW9XnAseD0Nkou569y5npUF6hm8DEMUMRSSgOl7Gi91RAiCUovFv6Dy8s1foONu/RayD4Gc/kXfiqHrTLTQ5WYmRsgwMbM/4OUwJ3TJlIyv/bZJTOwmHBDFHSPfVxMUA= 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=mDS98szc; arc=fail smtp.client-ip=40.107.22.69 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="mDS98szc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eOIG4s/03fQI2/cn5OWRyuoF/ZyUSnbTnFSxNfgYwgON34hWJxRF//LBkDekl1mbpVMPWTMzOoEQJW3XPwEhuJbtWicfvMPY1+LJP1UUHfnspdK/1fPG9C3qWlA4l776avLw2/m7KcBFlBJalWLXOGBcYCk2GaN7jZjl1ECzQOErnciUxrNYuWh46yBFyaVoxwMSIgayleqos46u/Qkmhw/qDNYQQG54Eu6WQpyeG3h8AOValF+QaUOMJPU6k/zCOfHh0r/jx8rpM5hJylHyVkhN5OT3oycKLYMMp+Z6gqexH7hMyGrWuBbt3cwSIdR4SksukSGYqqgfntlVDrJq7g== 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=OcCvK5MCXoTruYZPgNVyWJsLiZ/cz2+7HaYYDCYSZUA=; b=Y19vn8Grq//wbftvX1hncTX4DJzyICxJ2EddktSAmC3sQ7i/RilpUzcML1t8aEPzFhUlaelt2Leg05+urcUQ4z0Ejrf/Tges9ULiKPqCal+qOtTvU8hcKx/X7VoUpdDDRFOI1I+9Fm8fmhXyrUwnCwXcYTxBK1lGJgwuLUFGWFKusLzrwK0vpj4GldkxUFE8tlxmb7s1IN+6zFvDmCnIr/f32/VEKMAYnys4qmT2WnfREv6HAginmgIPaXfsI8UjWD2mz7SgGpn1wJl4GIY0GO0I5zzSw5H/qyOGcY/Rt+wNzF3jEn47IJO21QMP2yPYf4GEIrI0xLOSW1K+CSiOUg== 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=OcCvK5MCXoTruYZPgNVyWJsLiZ/cz2+7HaYYDCYSZUA=; b=mDS98szcmz+10Ke9Rcznsg1KobKAZAFAermY8JFAozPuvqtUW8cY4EmRPkNbKZ4sq9w7ZsRE35T8JU09MqrW4+t1ogS/z4TP840ETlYSfc97AAI/jz+9PKO3XyG6/0XLrd0/okxPmgnt8ZhxjEfVmqp3kYEKJSHJcrLsyZdfnrw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8909.eurprd04.prod.outlook.com (2603:10a6:102:20c::19) by DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.24; Thu, 7 Mar 2024 15:59:04 +0000 Received: from PAXPR04MB8909.eurprd04.prod.outlook.com ([fe80::ecae:646f:ba80:b0f2]) by PAXPR04MB8909.eurprd04.prod.outlook.com ([fe80::ecae:646f:ba80:b0f2%6]) with mapi id 15.20.7339.035; Thu, 7 Mar 2024 15:59:04 +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/4] client/gatt: Quit shell after user input has been processed Date: Thu, 7 Mar 2024 17:58:47 +0200 Message-Id: <20240307155850.68395-2-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307155850.68395-1-iulia.tanasescu@nxp.com> References: <20240307155850.68395-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: VI1P191CA0001.EURP191.PROD.OUTLOOK.COM (2603:10a6:800:1ba::11) To PAXPR04MB8909.eurprd04.prod.outlook.com (2603:10a6:102:20c::19) 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: PAXPR04MB8909:EE_|DU0PR04MB9417:EE_ X-MS-Office365-Filtering-Correlation-Id: adbb34bd-631f-4734-2da8-08dc3ebf8396 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2uuDt0TwBCJVDKqwBwhsRHosl0ppD2MzEssLeSXuuv3BmXBIsQ7kEPy7Pa4MJCQEyHq9QweCqC+hAQBdSOAK//vHx3pww3RKn7JznZRIi/LSQPPYnZyqtNd3nt2fynehC8iJhvc5LSO357hCcjUUxgjkAgD0IH56hiHYG2hDv2k5FVGaBk7HCWQnnRKhp8ktxdpq+d0FhBFDmfow/aUOfRn718Rfz1f1EuwcOsAUizA31/nCO+GSLofZdMPxYXic4s1/yzOnlGqKAD9lVaWD6/CzYoWmbKyT4j93IyfEPr3737d3fFL0AAi8lKuQr5LFkk4dbgjtoNJOzst/kVEQmTbdN2lx99+FElD71R1U78mJ1Uxeh4njBhvpeGseKc9Dcp84ne+fbIor3m0BCx5DpI5v+jVawvyNddl9tspts3GFiqDlCg/FpOl7PXoxylQNBavAQYUHMNK02juH8B+E4kJGVIRjNZZwKVtDrhR4MU/iNsaKozNGMV9KqEqoTYvUOTMwvJsoa/bGbniqZ4DyYdkEV/Lu/xDbHPTVSw0yxgOxKPyZgywlVbLTfo5vj91xaK6D6gvNey2dQgDxYSGGjbWlTl2b+Ixl1dZyGnYOfyz72dOMuo0YzN00a7BJ76gpjZdhy2ohczpMPveHwG2UtVLIJmdxfvXp+WYhm/1lvPw= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8909.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Xcu0PCpimq7qhGcxg17lvFLnwDJuUkyNkGw/mg08JA6ISS2ShZOzceokQZdFlrmD2MiQFWH5S6G5X+rZzzy+K36IKe3pNTakVUthaE3hPhMHtcqVkq6mnQ7LGehu0ie7xuYpHUX8YxSqRgdxv0sV5GPi7SYGP9My09qe9b5yjoVuWXYast/rvekjkcKdfRHarHUk4N/pKJJlt2DZ7CSFcBd1Rqqw9z2PBTSsTuVjzrM8hGnH61JU235PJRhWWKtj5uGrkofmIPjdlff4Ih0F0I292sulhiHQeXEfzMOJD62vCGUpzMuqwnF8Bux3tKpbpRpvjUHOhuE7udJfMKLDHPpmkvNI0A22ifwSUm45v8dOhVtG0YMdlfE3K6n7XfwBJqJo5n+2Yf69NUife2Qb+8/ju9uZRo5f1y98407fvndLiLT9sUfzLUjWqpFtZXxKxztN0CLUaFdtIobPvfSKMLLx6PDWDziUqifaCrwVm3/u/vnduHq4lZV37e7bFbfQpoMZEjVtgxbxLiplfKgbb2KakSELcx8UTuS5QuJK9qEYMweKpZPk5LcQGlI8sKZcF4IrKc0NJ+LCY9LIiPaKUzg0Zq970etMgFZ3zkKNlvNUV0bp1yD9mdPttmzcqBYZBmAs322v29ETYqb3mbVYld6Vm6Uo0sdQ8p8GIzJOWfrCzvvsZHkWbCyyUKI9DORS7QUNG7U8KQI+F2aQ9sAYgokYfu3/4u6MgJrrzCR40wUqJVa2ZzuBNzjYhPG+nr22JcFKoSNW9NJAONGXgbBkbMuD8qAQem+g9Q6dcpIS6tDMeiR3yIr39BJlQ27I66ksV+DdMElALrV/MiSbhBwJM3Aqbr/6GEMYGi9gWynKdSCPqQEjCvfNXoLzILLY+TSuwlV4FHOOrW4fLE4I7fl0R7b+BK9l+0exu+t60jEE/bIrHMfrJc69KEyCEMqteJxoQWjbq47lLAlMsTEQEtddrdAqF81GhfmUQmWUtIgY+IpITJYJjgc4aJzWh/TQ7le092ZCGwIhW2hpocf+wG5hNBQ83ABXx1okQTbTZ8PTS/Aw+FWKkWPYWVFth7WhklPUXI4K1A9dOpEfzXXO7C+A2w+EOLQCnZn8YYt0mZlqA//dszToA+0bIEe4yr1Jp9ND+UfID390e0p5E4wkk9Wmfh9ZMHujltDmBXzUjLRHUWbK5kUspDORCRaSonUBhW7jmYh0/WZ6S1dc4RdMHYzyt6v7+Gi0n0eJbVL49UUKYc9LZlCHV7zHZeNr+KALfOiKKxspDMuCVSIDlU6z7xT9/ofC9G3JVCtgLktR1aDh6GV/HHZdC3rUuMFIHaTGo/HsQMHMkhhKGGGuSRlq96LOEtxqziKcReRUrcfP7xWLNRdcchAlbTPJhAmU3A+4KxlKXxS6HDRDECWuQcjsA5+tS3erge4Ee8L6tsif0+3WySdb5QBZG/E7QjyinOsgU9pXsWJWvOsn+Unrjb+Fpf95MRRTxqgCEh4X22Gb92jCde0yh6aRiOZYJR+B1ZE3FL4/E/f5T/9uOuWqs40Z0dWrUwlR8b24xsP9vWP7DKpym+9sNaQXuDNqc3RH2rdUieKPFRn36oGSxecAuLYw7JKDrg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: adbb34bd-631f-4734-2da8-08dc3ebf8396 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8909.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2024 15:59:04.8744 (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: ga/N+DZIq+iQQF65bimKLi38XvZVjNMJHY2znjkX29bD97QG0tZkghOCuxLfnDvC37UNVzICzODLWXkbzJuYoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9417 Inside gatt_register_service and gatt_register_chrc, bt_shell_noninteractive_quit should be called after the input was processed. --- client/gatt.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/client/gatt.c b/client/gatt.c index f03fc1526..84b7f3f49 100644 --- a/client/gatt.c +++ b/client/gatt.c @@ -4,6 +4,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2014 Intel Corporation. All rights reserved. + * Copyright 2024 NXP * * */ @@ -1685,6 +1686,8 @@ static void service_set_primary(const char *input, void *user_data) g_dbus_unregister_interface(service->conn, service->path, SERVICE_INTERFACE); } + + return bt_shell_noninteractive_quit(EXIT_SUCCESS); } static uint16_t parse_handle(const char *arg) @@ -1737,8 +1740,6 @@ void gatt_register_service(DBusConnection *conn, GDBusProxy *proxy, bt_shell_prompt_input(service->path, "Primary (yes/no):", service_set_primary, service); - - return bt_shell_noninteractive_quit(EXIT_SUCCESS); } static struct service *service_find(const char *pattern) @@ -2761,6 +2762,8 @@ static void chrc_set_value(const char *input, void *user_data) } chrc->max_val_len = chrc->value_len; + + return bt_shell_noninteractive_quit(EXIT_SUCCESS); } static gboolean attr_authorization_flag_exists(char **flags) @@ -2817,8 +2820,6 @@ void gatt_register_chrc(DBusConnection *conn, GDBusProxy *proxy, print_chrc(chrc, COLORED_NEW); bt_shell_prompt_input(chrc->path, "Enter value:", chrc_set_value, chrc); - - return bt_shell_noninteractive_quit(EXIT_SUCCESS); } static struct chrc *chrc_find(const char *pattern) From patchwork Thu Mar 7 15:58:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 778926 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2069.outbound.protection.outlook.com [40.107.22.69]) (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 11C2012F581 for ; Thu, 7 Mar 2024 15:59:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.69 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709827152; cv=fail; b=H8MaGNrcVQUb5snTwYNSWRPaT1SWAUVHO2WRhm7oRhRBFrWxEUGtyA2AdHnMBRzSMxRHbZ3XmmjOOvx+Pg/ieEXP+yOHnJTzlG6u9DAwR3yECqjOlU0a37sOw4jkW7iC7GZUq4I7nMxzlJJ5dGREJIkECjpa2kNWKVsjNGrvVh8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709827152; c=relaxed/simple; bh=PVp5jfQ1XEOe7twhqGRJlKda7bP4QW4AE3VqnC3YbSk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=E59GFMbue36S4AbmRV4drbGJj3Zl57Xtv+A7Iqsl06xXic0qnopX7ZTLKGf9CEaUftHoBtEwCx88BXqYhfr2KoEuBckgRPHrk6+akumoXjSDlLkRVWdfGGb8Gsjcrd9g3OkYldSp+pby5LDIQYHTL15nzg+SOhMVPA2f/3E3WDc= 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=jmH0QgYY; arc=fail smtp.client-ip=40.107.22.69 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="jmH0QgYY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dcW0h20A18+BxNnANVGTpZvz6jMbm53s2KIZJ79vxHriu5kA+Wk402652XliF0vbF6xJVoHquxWSF7rle43sUhhTgJNQxmB/cMofpkF0ONnd0CKBi1Ze5ziKYqmwA12mp+TjPhlof4ywN8qk2C2+3ktnvS6ECeiT/RhUrb3vWLyJPwQ32Vdo6YXp2h9yoyteUFBesasHazZpwhUyLB7lUIxTGRxL401bsl/DFf6Wh9r4/sjAeRAsNZ4rmI8Ip8CBaV532+vvPByZ7Bw2pV7yvLnDDMUr+qwWkHY6LlkeO85eUQldS6Pm7ifW9kwcr4XB6dSb3TMvU8fCkRTz4mrSIA== 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=pmkuZUUebJphisEp0tzYvp5q7ksz+ZFhprqI+/QXjMc=; b=HkxhyU6zMnvrdvaGXLTgm9ny1FsWjmoQYxG4Pl/nIaD0fc/6nixKHeBXtfO9EE71EgYy4q1n+YQlsfqKPwqie/AyHLBaxWg30+HMLr8Iv6Q3Ki2wYVyU7GcjJPn3Ow5urveq47+NO8MHTpAgqXNz2Kq5rZG4gn5ASW4BMeyVs/eC3Qf3Tcc5StEBi99CReMXPNPyEM5oSidospRQ5+JttMcxJopsqkegZvrpdqksJ2HVgmpsCouQS3F4VN699ljBCZt1gqHZXnOY1ctvwAzmOxyI7ERvcNKBgogUpHCBVgo6ypE6AMNY96WsJdpsy5EBmBOUb90FBAb/CK/p3O83uQ== 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=pmkuZUUebJphisEp0tzYvp5q7ksz+ZFhprqI+/QXjMc=; b=jmH0QgYYsIQexOSAiLOoIeO8P5Chz4N8P5CZpKmXlhDfjCJCrkV9NcfmAs1UB3j10CcQnTBU3AvQ+LQ5jxp983++cfkU1DymP7tmkaYw+ewT6NxAfbpqefvS30ilJOb6fiwOhLTMOIAT+vAQwU4cVev+eRPJ1iG3h3AuFysuzTo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8909.eurprd04.prod.outlook.com (2603:10a6:102:20c::19) by DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.24; Thu, 7 Mar 2024 15:59:08 +0000 Received: from PAXPR04MB8909.eurprd04.prod.outlook.com ([fe80::ecae:646f:ba80:b0f2]) by PAXPR04MB8909.eurprd04.prod.outlook.com ([fe80::ecae:646f:ba80:b0f2%6]) with mapi id 15.20.7339.035; Thu, 7 Mar 2024 15:59:08 +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/4] client/adv_monitor: Remove shell quit from adv_monitor_register_app Date: Thu, 7 Mar 2024 17:58:48 +0200 Message-Id: <20240307155850.68395-3-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307155850.68395-1-iulia.tanasescu@nxp.com> References: <20240307155850.68395-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: VI1PR07CA0220.eurprd07.prod.outlook.com (2603:10a6:802:58::23) To PAXPR04MB8909.eurprd04.prod.outlook.com (2603:10a6:102:20c::19) 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: PAXPR04MB8909:EE_|DU0PR04MB9417:EE_ X-MS-Office365-Filtering-Correlation-Id: 3b2c54e8-068b-489d-602a-08dc3ebf859c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GwzkznNGa0S21FUXQrqBrskMOEJK8JjD3I9PmplWGysWXq7cFGy3/d2sCf08IGI7ZuItpLI/RBYpxWT4LYW2jH9P8Cm8/REWO95bfwQjoch5dX81Q4wb1N3uGgAVRUWsI4MyjdYZobZ8ud59faYetNvnBWgkt81wDoMRp1gR4NRr9vmLy1I6vU726iFT+3KadX/6Uo1mcHi67DMPd5Qqdbt3WCV0zln0wB0IFH/7v06AwSMZGJSYf3QXC8GgvUZ+4pegCdCL4fi/7BRCZSO1BS35uFeFJ2IhIFUzao1M4UsFvUmyxj98TEFNFmcpa2CmJtLD8gwXZmOrid/wTcnppTpD8BbqOiMHLm9tII40phbQHcDuxwlP9x5WPIJ3frn/xe1jlGqIfPwpZgolFEQ0LOlRuvqzdkteMJm2vJrrhIrn5FACP3GbpeqA2Gmh9ocBWN48x5SKgqL7jkQCizGyQjRj5P/Q5bSzG7ptshwegR2pLO3C0E2SQBqP3k93BPaT3wLKfyTlnvD/iuGOK0lo1IcWi6tbmK8RycEySHURc772C2rxwAJR1atHdqVJ1xm8QXRwfAzUfUTOmVZWmE9O1bvofwsIFShQ00K/ZQDUxut21uQZGzYWjXUdAkh5LYc7FSXdTa7RNQLAMvXGzouDK7lF1qgL3P5OhjusrOFyigM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8909.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: reW4lj3OLbuLouZiM+ZHFml0K2RsERKSFij75F4OV2M/wJFzT28Jt6KM+otyHKqFWtqBQ626cGXY0z1l9ShvBw9xk/hpZnMnpr6ADLgqD8TvBtRRlOGPNZJvAdHkcjjQVe3GMS/MYvrq1mGf5uZQmFapKgP5jRPsHRlLP2qv9v1IHdX5yJq0wZGeyGbwGpgw4qeS/gO0SCqpweiithudEyNRlnshiiNjPzkqOnmhIV/bskv9WjbTgsu++NFbVJco2nWlnUu01YzBEDRb9mwN+0+gdBDHdaCTQbz7wwjeRRrKM1oCPh3yS/QBsiGNmQm+4witxITkhhdKlRZKnlo/UxJNSAohUwAUMEkKIPi8mE2es7vKF18iZmel3EFmiTv8kvVBUFijR7yk8yQozDmeYGE39s81e8zHDQs6TdKdCPQVk2tGOYNus/Pyzo2nE3hmpYpCi2xhqTPhiAqQ3msisMHB2f25QEPYgHIuM6jltpVwm3JN2l1xRK/3maJbxil0VU/pVQxjRa8B19P/r2wGaL9zDjxMeJ/cOjJ6NcFaEzbmOJYZSswqM/YrLizdI2pYxjvPNkQ4RAHNGEkfTNvcT8wYGnemx5SiHGLGfDDSYDj8Ye8fdCsaRCdVb3ykeiGoVkZ5DLVxWRvRXtwUU6iYmNPV3mRdEQjYNUbSlZFw/Cy25e6kWHpSOlDW9ct0+YiKUMlaihG7Rdwp2tISzkKVSLlMgrBvKW85Ad+Q5707lZ2XSUTC2ntrolCUTVGS9l6mNkKi2Uz2iwKdmgVWHcTZFef73dUUFxgf4cmL7IGnJsvqBgLQ2i/38yErBZdSKbaX3DqCkK9qN/HDxVCYe3gIEm0LulYD4N99vlYNyEibqXAGoxG2hXLJ3U0irjtA0Q49EzxTJjYPMmqytDXjT9Jsm31i0/tuCteT6Y7xSPsHgkX7J0C4KZHkbbJEvrRa8f6zor03pscw+k3yp4ucXBxM1Qy36np62LHAy+bFk2WmobjV1A3fNe/zq4dO+jook0dtg/lbbaKI3bmMmyDJCbOzZETwggX4mVAtFUwl48DDOMYi4nW7fmwBM7D2ePZEpIQ40kNANC9wMhIpvK9+rOO5cAnKM6qZ5kHanT4gM6SPfp6hGVtHzCOH6hzWFi2WvNLj3AeInXQWnXbJxyV0cWp5Im8sNjxQ9fkXFurnwpDuZwSkdBd9svaNWTy79GIAwBIpD52soW1Bp4KWpmDrtCD2xe9YeAYF7sEM59V/4LU7X1whZtqj745a71SaXKK6QfgRmxo1zHskCVzgJFY3kV3vKOn6iocKNaWPlQqUbZD8/iKcO6mdmqkNuACCN11YmSW1Hwu++6k4fEwQvsmsI9G3kJ8OGE+/YZsv7kQ69foV8SdoNDrBM+t/MuygNdhFLd3/K2bckOgnVaCeOev4sN8BTvvGzbDejmafNlgF/SMLybszCoFAXVgtSWmae3B96YUntS3CsByhC0AYuMwE/Vg+VtVTEsKlrFznTN/ARlXPunamqNDJpjfbtIhpiCe7raNpXHPKaOiIZ0wmCenmJW0rxfxjMhoU7cz18Racdu3ixwL2jfh5osIzB4dKcYrBBbrqAWO9krGuRrjdqUyUp64JZg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b2c54e8-068b-489d-602a-08dc3ebf859c X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8909.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2024 15:59:08.1967 (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: 91dsn0j27wUG9eQ6SkIJ7KL6+uPfMSwTVc5hLrN0ail5158eG4ZUVhZuhXEOHst/pszEikeEN2ZPdL0QYgqgfA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9417 In adv_monitor, adv_monitor_register_app is called when an advertising monitor manager proxy has been added, when a new adapter is added. This commit removes bt_shell_noninteractive_quit from this function, since it causes the shell to exit without a user command having executed. --- client/adv_monitor.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/adv_monitor.c b/client/adv_monitor.c index 792379fc4..29e670960 100644 --- a/client/adv_monitor.c +++ b/client/adv_monitor.c @@ -4,6 +4,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2020 Google LLC + * Copyright 2024 NXP * * */ @@ -372,12 +373,11 @@ static void register_reply(DBusMessage *message, void *user_data) if (!dbus_set_error_from_message(&error, message)) { bt_shell_printf("AdvertisementMonitor path registered\n"); - return bt_shell_noninteractive_quit(EXIT_SUCCESS); + return; } bt_shell_printf("Failed to register path: %s\n", error.name); dbus_error_free(&error); - return bt_shell_noninteractive_quit(EXIT_FAILURE); } static void unregister_setup(DBusMessageIter *iter, void *user_data) @@ -408,13 +408,13 @@ void adv_monitor_register_app(DBusConnection *conn) { if (manager.app_registered) { bt_shell_printf("Advertisement Monitor already registered\n"); - return bt_shell_noninteractive_quit(EXIT_FAILURE); + return; } else if (manager.supported_types == NULL || !g_dbus_proxy_method_call(manager.proxy, "RegisterMonitor", register_setup, register_reply, NULL, NULL)) { bt_shell_printf("Failed to register Advertisement Monitor\n"); - return bt_shell_noninteractive_quit(EXIT_FAILURE); + return; } manager.app_registered = TRUE; } From patchwork Thu Mar 7 15:58:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 778631 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2086.outbound.protection.outlook.com [40.107.241.86]) (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 7CF551E897 for ; Thu, 7 Mar 2024 15:59:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.241.86 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709827156; cv=fail; b=ns539rXcf216jGD2vBTdB9kJfss9o1YbrjPsLQzpYrLCXJi4F83X9pnK7CCBbyu7GTQwoenAjkEFnPUMxHiqoU9uWWbG6HdGNp2UsCer+5tKf8RDvLlu/IaQeEwjREsQa4CROy/SaJhDxtRPI1PC7gU8rC0vZH72VyhGhClcQdQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709827156; c=relaxed/simple; bh=vl1jSDNJ2nahIYb+rAa7gexmFZhIK8hAOnu2PewIdik=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=IZHlBTKmIsi5CAGZJw7o436lVV6dzlko05lWdyAP83NbGIeoxl4c4EpzgVMjgGj71wTA1O5txomoOK1LZ7H2o35aWOOP4+EZW6UG38sGPk2PITI/6+ibN1TL5vH+DXGnbXi9ED0XfZ3AsKd4D270FpMmHZzGow2NB5a70wIP9L4= 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=eBGG0f+y; arc=fail smtp.client-ip=40.107.241.86 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="eBGG0f+y" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gAGR/toQoSXtuQUtLnhENo/8mu1nYF/w7tSwLuBET/8XjuFQ7BiKSngi+m6ZCqs+ZQQWIlgoeVtOyoe79TDzTW/8hjXUdeSikf2Th/4exFnbw1NhmqUToAv3qrjK9vo1lGwWnzzONGWns+Rqd31F4zi13Hw2IC4wizaX17MTizSIK6K4Gb5pI3KmDB+P8CXrBTPyCvi+v7sxuBsMYuwAYl/gqRPt8/4pBcgWL6gbMUsGCiL1Iqjr8t8UJQ6L1RPKNpn2nE6cE4YKDr1J/SjVxQ5lSFFNtIxRia2f/25irwq0fy4dr+2ehpyBP3yXyzMjE/X1XIQudh0xtGjAsx4ceA== 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=wBL1+u47G/dFlowULJNiJL8Tged8zLx4DVsiVpFUyuk=; b=K1eeRSssWgg5J4l2q7LImSHwzrs3WqeL+dNGTHcarecxpKzHokYsS8lso3IYJ4MQgbCEizMAS/tIJwepzwl/XhWUrduWEYoKjM7XflNxv+vdIp1QuOId6tD+PNMeWN7sXp/lbbiquQKp1K2wUsqq8tuVAxxxHIRXYnSW5aMmdlDeAh8JP7qqjKRK8LApnb0mfB9mHJB1NPtJeuVm6+maIU5FA7ZKLwfNRkwMNAJTNkI3rwvdo3YxMpgfn2SnmwzSKHf0fcFDj76RLF8S5MNjo6vsr4M8/pywy/B9XsSXgnu1zir3TP8VN9YiZcRW8Re46SHclMClzAmGg8v9HDde/Q== 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=wBL1+u47G/dFlowULJNiJL8Tged8zLx4DVsiVpFUyuk=; b=eBGG0f+ypx+Orp7hbcbw6zZ/JMm9Jc/vBZFhk6yzoq5RFAqLUMcrvGT7jWoHavUOyh/akLmB5dTuxjO65coOz26nFE2UjLxf5Cmg1expEOPgqC4eo5TQPs3OwV/ibwZsG+U6fqAziVI/8Bh/UWnunZg1Vc1+Jh4+2/0wtgL+7Gg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8909.eurprd04.prod.outlook.com (2603:10a6:102:20c::19) by DU0PR04MB9672.eurprd04.prod.outlook.com (2603:10a6:10:31d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.24; Thu, 7 Mar 2024 15:59:11 +0000 Received: from PAXPR04MB8909.eurprd04.prod.outlook.com ([fe80::ecae:646f:ba80:b0f2]) by PAXPR04MB8909.eurprd04.prod.outlook.com ([fe80::ecae:646f:ba80:b0f2%6]) with mapi id 15.20.7339.035; Thu, 7 Mar 2024 15:59:11 +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/4] shared/shell: Add fixes for the init script scenario Date: Thu, 7 Mar 2024 17:58:49 +0200 Message-Id: <20240307155850.68395-4-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307155850.68395-1-iulia.tanasescu@nxp.com> References: <20240307155850.68395-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: VI1PR06CA0139.eurprd06.prod.outlook.com (2603:10a6:803:a0::32) To PAXPR04MB8909.eurprd04.prod.outlook.com (2603:10a6:102:20c::19) 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: PAXPR04MB8909:EE_|DU0PR04MB9672:EE_ X-MS-Office365-Filtering-Correlation-Id: 532b70db-dcc5-424e-f704-08dc3ebf8742 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /3/AR73seMU3Wl/p1/dRfEwIxryd6aM74Btk0xWWRTmYV2TVq38P8jxgnP5uoNJnm/MggpxyUSi7BhYqgXJaPsrlrmYlFA3jh8clDSQ853Mstx7UljJPPGKZq+5kHusOOdOoi4KPTCwz9WdOc9/B7IWEmw7fkNPKJFILwnY1SUsDccqRxTfFB7wSH07Ae3nxtcMJ4QktHUttMch6F/D6fKuCNc9zw5Hqu68Pc9hmeAvfNC+YoMyuqYfEnBNPYt02YKD6IDzJliH5TQlbT3bQP2sddVwP4iRa9m/etMWTX5m16fDrDIvSOqOxHw5NmfiGXQqR5nM9nujSVfpxv4u8oEz2CxRZjo9t8aBAPzXuHolmMiZJYogCIGKBocOign3cl+uwnjmg2xkfsVxxZ+jrwBXg/v+88iKqhQI+Hhs4e6U64ATW+6ymzYLDzArd+xODmTF2602Go2R/9MlFVdmiLay1uNiBaePlzPStB3y22oePcBJG8Vysqcsq1hSK72JWK8ul1yID0uGf6eX/8NVjMqvNVT+0ttlpIvJZw/gcuz+Yv+pLcm257gBCfP+por0wwYABtHi/Ue2Rvg59+yiFP+FpsGIuMMTFSlYfvS9ryo87XrGL+LJkKKFGG6sdHwVwPxWjcXPepsjw8JJ3hYuTPepYW1MrbJYhDJ4TgAuHCqc= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8909.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 38aOwBbHNbk9Lv6tB8atP4+N4nqFVvWStDnTJ2NpXmL7IXF01N8pSNMCk5mqyY7SoPcZHmWoYZQdV1U8cijKRtxL6IJ8cSQxuIc7LfIRgHPM0XcoEvsiPMzl7CCJUG7zJi0U5ioYfBMRizuwScqNL5XmGk209SQzhKsj0XMA3I7fq1elH2yu0umlU1W2Oo18236/hgVhp+mPOyxJbBQ+JtqTYGDxgn+0PWoXNF0c6BlyAQqyGdRVJDa6wp76SzK3ysmLqyPiyp8ff0SXupM4cuEkKp4ubaxpJc/DgGm23xJSvIDflLF7IA1y42QoKL2xDHz3cMqmXkGSf0FgmNzTe4AMccg7UL+17VTGylFN6veZpT8+RQMmFbPKlqdCjP0Mska126cadGBWJxvyC+o5ezwewrb3QXntMYyMIkirn9j10q/aa4SueY5kk1j7us2agU0d/3k9N6zIwtMIxrdO0kq5iQgzGt498pKPnixyUHzv9urLf4HBb5YnyEvitzoYNeCRf4sfIYyevRIEOHpfShO3Bo5ETwWnU/l/AlS2ppHh6ek6f+jee4ig28l6n+seeqVsqoPPqLygu7tDMHkCdip/rFrsLu65/gmve21MsMg9MHcs9KxmHOQA4az9tNFbvMZC2s/YYCTYwDkL35vy8TGO2fqfDVW7ns6koWTJ7/FpVUTHi6xDXoerOJDwTVeJEFjbFZRjugSZI/rO9k6FThJQok6qFevKuqqmyHhVfYtC7lIZBpa2j0fhx39ABZNaDcIjKedr/hK8cjZQrLKAMWB1U2rOiYDy2JoLqgncSLn5zUO9/x0hsHOHZMGcr9tqbS7OzlsNbswR4PQ+/g6TRPFZBcZuWhuB39LshGFkJPoXpzNfl7eWmcdX1TFoN/fH9RJm6ek2nTtAkRdOf4gMbDPtEC+xh3sZdDNl6uQPzqkP7pOkD2f9s+XNW/xDAB0+KVEWE36xi3YeMtKmiTUbxfGF/HWvuG1QeSL+sdyaw/1DAivTjZekFhXeo8ChlXMYd9SuKPG2pSlGPM/8Yk03gDVxgyqmIHaC79X4SV5vLZe6BgIbfvgHajivvEgzWyfojJqMVwwaQTgi/irzq/uZ27z9v43zX1OdEXiY9vdNeVqgLppdfMM/FNeFe2tSnt2Db4U+Razk4pJ8ymGNZ9HjcIjxs9ZXh5uTxvVpS4Pa2ji2NgVEP4GU0UoBIvy8gsaORaNhZR/Vt6LRrmeRJywID2j/SyaztVXwKXpW/xFzisbPG0bwB8dEHfkI8CbWXf2asm5SXoHhaV8Y3TLcjko4dCZi4EPPravm8rrTpbGFMYd/q+gKkFqwsf1ifdI7NOwdtRbO+MtuyOVYSB3dmZrPLjKzwQJjYO62pdUlk90/1784rBDVPfsfcw0qlgo2f84NmvDmZhIeQAPZ0qrsUwOvGAL0GwFtSypLqH/t8HU/Jeu7ZY4bWvkrC5dvh5woG6WeN04nTV20Tcsrcn9z/VW8xbWQbgm4Qz1jCEZqF3Mzk6qQ+wyiQPjuCJ8IrvhslsUqsL9X2npAGrF6WOWoxwwkwHuUOpGwj2ZjTvCWFADzfaRfIn7Y53OKJY5ttiS4sfH5+t1QdB9rl1u25ejvp15B7A== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 532b70db-dcc5-424e-f704-08dc3ebf8742 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8909.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2024 15:59:10.9770 (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: IobBcBZQTeyimu+uocGjBDkW4JFetNcesPp2Wlc+taGv/Il+ztkoz3hTHDlHMzx4T7uTtO9rzGztGEiBRmRYIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9672 This adds some fixes to the scenario when the shell is run with the -i/--init-script command line option. In bt_shell_dequeue_exec, if a prompt was released with the current line, all other prompts, if any left, should also try to be released. If no other prompts are available, the next line should be executed on bt_shell_noninteractive_quit. In bt_shell_prompt_input, if data is already available in data.queue, execution should continue and the prompt should be released with the input. --- src/shared/shell.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/shared/shell.c b/src/shared/shell.c index 7bcfcff3e..0e4cbb7b1 100644 --- a/src/shared/shell.c +++ b/src/shared/shell.c @@ -638,7 +638,15 @@ static void bt_shell_dequeue_exec(void) bt_shell_printf("%s\n", data.line); if (!bt_shell_release_prompt(data.line)) { - bt_shell_dequeue_exec(); + /* If a prompt was released with this line, + * try to release all the other prompts, + * if any are left. Otherwise, the next + * line will be executed on + * bt_shell_noninteractive_quit. + */ + if (data.saved_prompt) + bt_shell_dequeue_exec(); + return; } @@ -693,6 +701,13 @@ void bt_shell_prompt_input(const char *label, const char *msg, prompt_input(str, func, user_data); free(str); + + if (data.line && !queue_isempty(data.queue)) + /* If a prompt was set to receive input and + * data is already available, try to execute + * the line and release the prompt. + */ + bt_shell_dequeue_exec(); } static void prompt_free(void *data) From patchwork Thu Mar 7 15:58:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 778925 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2086.outbound.protection.outlook.com [40.107.241.86]) (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 DFE7A12F593 for ; Thu, 7 Mar 2024 15:59:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.241.86 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709827158; cv=fail; b=iJlOguLvEC+rLOJKZCEO62Ieh5tSWgXz/40fOSMS+KdgkTYI6ER86s9A8pbUyWPDoXulDnne70WTOK5MuX0nWe9yhQKopBuXyITB0bw9DmmfPpeQL4Eu7o5djXD4eUkTlsXMyONrriot6/y9EolJS2jFQK/2RlxFqhT3Ehy2HLc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709827158; c=relaxed/simple; bh=EuidPfYEDWknDNFpQaCYduFSZFZBwvn8/+JpuXmcURk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=hXW9TJvEC7MQUDzVxjRlXOECE1f6SLjUTUlcRkaU7y+KMeCXjSvB8eAoTzFtY0I8zlaH2v0/LLMLdnz9/iuYSCp3e+euhxFEUgH+xqnbRMLxfp6dR4wnXuxPhgG7xFX7iHoknnugNQF3QRSREY+s7eC/A+J31XKOvyQZi6aDWsM= 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=djIFEess; arc=fail smtp.client-ip=40.107.241.86 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="djIFEess" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BqempCvVTNuBi9eGUbY/hg2C//aq4RwiyxWuFiw5ui9ShN5oxD6AEBBKR3zQVDDvcZto5DqxrS0zrfAflwULbXuR/uNgd3KcRzzOsROH0KCpYCMgTXaiAQvAg49/gQddYqRevg4UmwHiyyRdwJDNmrMt41ESRgPMIEmWQL3qpOKBSQrPGV9c4xhdFbcRcwZQm7tpQzI5ABJFtIzkikC62SaaTgPWm/b7D2RWYjgWBWKudZEoyo2jWTDVTRkdhekYCWuQTH513dm8B9rwoRk8EUSwLzvQQAIFI0hOgzO81ZCsY1clOMIGk4VQ+KGIcTNH4qetLy3rFrWOTEI/UACPvQ== 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=jiOVFFf0jdSf8xQV20suE5rj5bIRrCDGrLibE3xIMcA=; b=L4yJAK5r+WKWBaG8Lz7kwKKk3Xv+7/pzqZ1laDdaNYm/kd8ePS+czyOvIMjOOlLkysJ7wjEmfl+AacKrooCFKhTnE57tXmLlDxWFHFIx344/Pekf/oaRvngisjl1rOct7W20Xa1RKxlw37WsS96qZQMhY8ocDD5zEoDJEFnmbFubDDbAlkhUNTbq4sN3pfqvInvZU1oih6/T14+jY0i3qeZn8RTNwIgyX+p11oowH3wjfLbRBjV6GvSbRmxm5+dXhPkPRQHMsXZK7I30cjP0iekWrFRg2JOsI1zXdL2ZkqFqLTloZp9u0pO1DToM8olmjqPB9Y67veBysuw/VJ4LDw== 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=jiOVFFf0jdSf8xQV20suE5rj5bIRrCDGrLibE3xIMcA=; b=djIFEessq45LXwpagWBDqJCbHFH0m30fQ+9gBTWQqFq0NbzoJi4Yga7MLUB32AYeV6tTi6lNvl6Cf4FsukvI9dWU0YzPDfKg1p/5/VrKyo7iChkmDqipZY0B+5omEJQMdfZf8KcKOQZ6OChyn949Sgg5sXD9E27zAJQKdPmNS6E= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8909.eurprd04.prod.outlook.com (2603:10a6:102:20c::19) by DU0PR04MB9672.eurprd04.prod.outlook.com (2603:10a6:10:31d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.24; Thu, 7 Mar 2024 15:59:13 +0000 Received: from PAXPR04MB8909.eurprd04.prod.outlook.com ([fe80::ecae:646f:ba80:b0f2]) by PAXPR04MB8909.eurprd04.prod.outlook.com ([fe80::ecae:646f:ba80:b0f2%6]) with mapi id 15.20.7339.035; Thu, 7 Mar 2024 15:59:13 +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 4/4] client: Add scripts to start broadcast source/sink Date: Thu, 7 Mar 2024 17:58:50 +0200 Message-Id: <20240307155850.68395-5-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307155850.68395-1-iulia.tanasescu@nxp.com> References: <20240307155850.68395-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: VI1PR04CA0115.eurprd04.prod.outlook.com (2603:10a6:803:f0::13) To PAXPR04MB8909.eurprd04.prod.outlook.com (2603:10a6:102:20c::19) 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: PAXPR04MB8909:EE_|DU0PR04MB9672:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ecceb1a-3a80-4f61-c59e-08dc3ebf88f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IrLwJwZR0xZYlFK/QS6ED9i/AhaI0H7IayxhNuJvGZJInBmBcWIOD0K/94TwG9bXeUfmNInIcmfsJxoSQRsxrNe3IarnO9a1j6x3fIOlYJ5ENhXA8ZhtFDb0UpMEoJOXiJ6JkdEbWk2pBzzJJ4J1heEQLBnk9gaeW1FVtag8d2geGxydaEB9OeU8GZ3yXhR9huIDpTPeSo1VZGgJQaxLGo+mI+CKmasAKRgIyFQvFELwzM8agEy0BddSeKccZm1yonaSWvJZhNPgann6z5KK2Du+kyDHq76IkatLbetkF936UcqJv1pfeICIpdJvNirhO97zypaSTz9swMxvJTy3d5yYtj/Y5m3l1LOpzzpCMUO5rlk65cCTAPrEcStRCfN7IbsBgO4XmtMxl86WpWpZB4hcjBd6Cd8ssCjBrPVWr3097qKh2DfyfQf+ZpsA+Nv6DvJCtdFNj8V2fLyeMj1nGezwGPBNGL5wqunfHVTgb4xTZUK0BMEVk5xe70J7U235j34mjjQVkLSkt0n79Y5dKHi9qrBQDR21OCVCGyuZdhQFqNpG3FSX9iqhcixRmqkNxETR27eWD1rqXimPSgoszkdayIxUY1rHe/ga4D+nA7zVD2kYvxHU0/QjZ14GCvsmJkvO54IemuyzhDYYBJfaPu5Skb+/ioWL/MVqsdudDIo= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8909.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MIRloljUXPiLpJium4vkcGtN7LGWIWXQ54ciDFRyF3B0mN4HnKZ/1G+zC9CAnWH68bcr5YWKKzyl43bFEPtUwUD5JpSl22Z6ln55INsrzk/yIGnm6zbDWF7RSuHC4JHnqtUSZNP0FgYQ/NckiEvekBNylvCVAGkPnGIDXr+61oL4PTCyQH1BeraSV5CXWfmZHcFcLBEpoYRABfBtr1PCCoJTu94sGdmT7k4yf6N16vdwgDZOHYY6L4l9F019pRLsHGp6tzFwrQeXDG4exyqNEBKCfZtsJTBHYdFlyAxm/Yy2GCBu94HDPWZE3W0Mnued5qxCS6ua0WmsQcaEDB3RgtwjFFI9kuKcZt5T9WtttQu6XvRH0IX23yQZHWe0wpUG9PcpJxw40EQ5GRZVr6pb+r9gn87CK72mkfUE9vZlMa2FIpox2dxxzip2zncB6B3Qd7EeXZ/Jb63wXDoaOjGeDobarC7cU9J3JRqBx0NJZQstzO5zLmgzYFR1SVSfnCNR1RogMlou2rbLWSeA3MKAkf/9h8VxxdLdKaXekiXiStscbff6qGn5b3mHlN0PUZNKssLdEAy9s8JHfbcyH9mrmncdrS8y0Dppd9Bhj7lDgxYhXjzKxJ5GpUPH0i7yU7KP0ONn3BYWqsnAGwnoL0cFpVmO+MJYUnUpoIs8i4DOnQ8epdHJF4mnbM2kkvBMaor7swlMFSGllAy5xDtH9NS2lalb3e9ppfGm3QVHsmSTuOohyjCRzlRgKdgB6ZRUbAZY3yGvw2Clk0g/TFnEbXDnsUHsoRD0cGiBARmvZUBrxi4bv80xhKf2f452d2U5/A6KZWvO0fnmI9oHvGcC8b+TykrMurjWL7fT4a9bAGFcXkuEuP/+/KvuF4bNosx+E3FiNSICyQLKpTkkM6KYBQvo7lnt6Rk83qpSLiv0z+by+0+EZ5NlA4u5i5JFoMWnQayQp8wg8S5rZUYzZzo++Y/XubU8jKJje4cU/b6TbKyA0/z79DxWfBQhidg8JFyvKn7Gyd7gF1tWm5sniA0p1vWhNWPIpnWvswydbZjXJCkZkehtkzIKvdNDPYdc/UCY66UxwVsZWOkuGKZMY+cETTY6F1rUKyn0gs61xmICh03yQiLfeAbYEkastSyWegxgVEb9xr0qAQdem22lbyUzz6iHqIn8p+bcMI099EbnVHKs8hSfNNbydET52jBo10vZ2pI07FuTfdiQX4GBiTWH4HZrs/gjvCaT/0ipk+gYYYJS/JNM48VgZF0S41M5gTP31dgarqcz8KTow1CL+RVWWAixfk5ozEGzBTolwMbSbNlhE/nrRYfXIV+uCQDEQGnDoJNQVn0eh8/V674Hf4dbBGG4x4Bcm0EutHURUAPFFDnup0XsYnLORzQmu/4iE+9V8bxWvmVCa066MWnF+wQ8uchSZxtMYQ7Gdl9BgW3zU2J+okcGfD5kM+Fm+d0WxuEusw4q7HoURILOUTGNHcNcTN4vzUVniLvDsyINtEOiMPBgZCYsQUYaPRUDQjIhtgMz17gU9yV8WxD0K1PxblwCLaFidCvap0Feo5VekZXWHaqwdivZ7PyPQ2F+mQuO3V9YvFAjLRlEKG8jYDqs75Psf5b8Ww== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ecceb1a-3a80-4f61-c59e-08dc3ebf88f5 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8909.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2024 15:59:13.8222 (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: SUEYj8QYSq+4pFwNY/BQCRk8NuXkiLypYblfH5jT54mXu/b/wtL+aJcE/gbAtITtTFg0TLXdExW/ZowT+nH/Kg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9672 This adds sample bluetoothctl scripts for the broadcast source/sink scenarios. The broadcast-source.bt script does the full setup: It registers a broadcast source endpoint, with supported locations as FL/FR and media context supported. It then configures the endpoint to create a stereo media stream, for the BIG handle 1. The transport is also acquired. The broadcast-sink.bt script registers a broadacast sink endpoint, supporting FL/FR locations and the media context. It also starts scanning, and the user is responsible to detect sources and select which endpoint to config. --- client/scripts/broadcast-sink.bt | 7 +++++++ client/scripts/broadcast-source.bt | 11 +++++++++++ 2 files changed, 18 insertions(+) create mode 100644 client/scripts/broadcast-sink.bt create mode 100644 client/scripts/broadcast-source.bt diff --git a/client/scripts/broadcast-sink.bt b/client/scripts/broadcast-sink.bt new file mode 100644 index 000000000..b912231b2 --- /dev/null +++ b/client/scripts/broadcast-sink.bt @@ -0,0 +1,7 @@ +power on +endpoint.register 00001851-0000-1000-8000-00805f9b34fb 0x06 +y +a +3 +4 +scan on \ No newline at end of file diff --git a/client/scripts/broadcast-source.bt b/client/scripts/broadcast-source.bt new file mode 100644 index 000000000..6da9e23e2 --- /dev/null +++ b/client/scripts/broadcast-source.bt @@ -0,0 +1,11 @@ +power on +endpoint.register 00001852-0000-1000-8000-00805f9b34fb 0x06 +y +a +3 +4 +endpoint.config /org/bluez/hci0/pac_bcast0 /local/endpoint/ep0 16_2_1 +1 +3 +0x03 0x02 0x04 0x00 +transport.acquire /org/bluez/hci0/pac_bcast0/fd0 \ No newline at end of file