Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2155570ybc; Wed, 13 Nov 2019 09:47:48 -0800 (PST) X-Google-Smtp-Source: APXvYqygQd/9HQC5uHCg8vRXKNpUzjmLrrkFFbHMAHqnLedl0+HO9qXbpXS94GB+iZFQ5NP1ZUqG X-Received: by 2002:a50:9b10:: with SMTP id o16mr4889175edi.117.1573667268596; Wed, 13 Nov 2019 09:47:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573667268; cv=none; d=google.com; s=arc-20160816; b=OBzbB6zthJqB9rXnAsV2l5uPSt4fuC687mzIsgmjPHkThOSXkENEUzpL9i4l8mZHEN 6zF5yBThVjOz5bOu4aXNRtxSsB+mO6Ulxl6MNv10qAEd9ur8PSBNv6u7BCCzv7SLv4XU wlKwohYNiF1gTEcg4wg2xGKKVjB6QF+dMEeJo7G+XKCKFIhSdv2/7vku/v8g+xTT2dY5 FkXBx5TXPWR/Qvtc/wAAKFW0286H/gOm02byU3DhaF/FObtW5Gr2194uZOjoLa1mxTpJ q4JBeI41dadamnVueminaMe7hu5iPxw2XJFmzAd7vdHCqqb4YmGpvvXn5bxQndt3QBel 6SGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=F2W3S6fSAPS22Y20Zw1Fd1jjLpKo7b1BbZvmEmfJ9/0=; b=S9CyXqz9CbWSypLuVfOH4qU4nMjbNYJ0/MBVOvpFoBQxc7cg3PYnxInQX6HxAt+R86 edjle1W25jWIBZBsNfe9Gb0QEENMkrZKokMW4x41ocN6XPTNrZhaNQhwKao8Dx4zgWC5 7oX6dH9boY6wXI0oiK5s9UsJl6IjEFqkoV0YjZrkzC3XrCd5CxrBrizRnjR7NshDOnWP h2RPcTdoy9Ff1gfjc2IATnKwp0s+Q2qh0NQaK8j2BgSQeiblM9p6v+pFINFtFq4l7Tlf NVdUV91hTfjZjdzUZG/DrirV3naIGNTbsPUq0IyLb/KFgfdV5kuW1XdW6Bh7E6YEKemE NbSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BkC55SDN; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r12si2568597edi.272.2019.11.13.09.47.16; Wed, 13 Nov 2019 09:47:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BkC55SDN; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726350AbfKMRrC (ORCPT + 99 others); Wed, 13 Nov 2019 12:47:02 -0500 Received: from mail-oi1-f196.google.com ([209.85.167.196]:39621 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726105AbfKMRrC (ORCPT ); Wed, 13 Nov 2019 12:47:02 -0500 Received: by mail-oi1-f196.google.com with SMTP id v138so2568059oif.6 for ; Wed, 13 Nov 2019 09:47:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=F2W3S6fSAPS22Y20Zw1Fd1jjLpKo7b1BbZvmEmfJ9/0=; b=BkC55SDNjE8ltR+xlJKO+aB1udeYk1KGsJn5ilQN9mi+UqHLmjQ3LAsfvpuFEJRG96 MkAnyIHNAi76nHi2aYM+W/E6yHaOf1r48BAgVe2vrUSL1cQzCgnChOX0dbR5tiZ+jUh6 p+npxLRn5z4mI/wCwlzoShjpo8S1KjXod9C0fSAiAMXph73RCKbDv6bKbsyA3u47WTBG xQTC/6bEFmhXAlg2ybEoVP/tAj4DmwYyvsKn2st9BDcDrrqpcXF2H0bLtE89Hjgo9tiy Hc/r2Dk/d5y+hGUTPrysNvUQqfyraZtyd//CVz6mrZghoX0lwtBJl1wzLj3OfU68VVIY 4bgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=F2W3S6fSAPS22Y20Zw1Fd1jjLpKo7b1BbZvmEmfJ9/0=; b=MzAHp8FkZEkH3eCtlJdwMjh6ThlWeKJmE5qLNefyo+hODrS2QB0+pK0rGNOciz14bb YDstiEC5P7T7nWlQfWFZg2Vn+thAunLZ0tarj9BVnq+XbJM929J2xbZXYkX0qQ5JKfkG wUhdt7qM9bjSIF3NgOrpgpjdejSvKRPK4Un5TYF0gu7bVPX7g68W0hcP+W7wDEyPVnA5 YHm8kcLtl8aQyvPJn1hvbHGIUNJisSFPSXPMfd+Ub7G7MOnZ8iyij589vtgGlBD+iDCw K098DtWbXnzTNWHCavdsMljCTcPV0UvhIrd8GpD0/EwffK06YD6yp9tBzvSDbIhJFKw1 iVLw== X-Gm-Message-State: APjAAAX6NOfTQpkDRfvpLCJ3zv5g8jppjH7PfsZqBGi5qQlOTB5z/CSZ wGxqXMzr1wqedDpXAAqxSr8j+p7BPE7LN0lN3fQ= X-Received: by 2002:aca:c756:: with SMTP id x83mr3667168oif.8.1573667221041; Wed, 13 Nov 2019 09:47:01 -0800 (PST) MIME-Version: 1.0 References: <20191023054119.7712-1-inga.stotland@intel.com> <35ef6466f21e861809ddd89a04019d98ce869918.camel@intel.com> In-Reply-To: <35ef6466f21e861809ddd89a04019d98ce869918.camel@intel.com> From: Luiz Augusto von Dentz Date: Wed, 13 Nov 2019 19:46:48 +0200 Message-ID: Subject: Re: [PATCH BlueZ] shared/shell: Add prompt item to bt_shell_menu structure To: "Stotland, Inga" Cc: "linux-bluetooth@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Inga, On Wed, Nov 13, 2019 at 7:33 PM Stotland, Inga wrote: > > Hi Luiz, > > On Tue, 2019-10-22 at 22:41 -0700, Inga Stotland wrote: > > This allows to associate specific prompts with main menu > > and submenus thus providing for better navigation when > > submenus are in use. > > --- > > src/shared/shell.c | 3 +++ > > src/shared/shell.h | 1 + > > 2 files changed, 4 insertions(+) > > > > diff --git a/src/shared/shell.c b/src/shared/shell.c > > index cfdcc76c4..a821c8d0a 100644 > > --- a/src/shared/shell.c > > +++ b/src/shared/shell.c > > @@ -1226,6 +1226,9 @@ bool bt_shell_set_menu(const struct bt_shell_menu *menu) > > if (!data.main) > > data.main = menu; > > > > + if (menu->prompt) > > + bt_shell_set_prompt(menu->prompt); > > + > > return true; > > } > > > > diff --git a/src/shared/shell.h b/src/shared/shell.h > > index e14d58381..a9eee506f 100644 > > --- a/src/shared/shell.h > > +++ b/src/shared/shell.h > > @@ -53,6 +53,7 @@ struct bt_shell_menu_entry { > > struct bt_shell_menu { > > const char *name; > > const char *desc; > > + const char *prompt; > > const struct bt_shell_menu_entry entries[]; > > }; > > > > Do you have any comments for this patch? I recall experimenting with something similar, but the problem is that sometimes there is already a prompt set, for instance we set the address when connected on bluetoothctl and that should probably stay even if you change the menu, perhaps instead overwrite the prompt we could have another section so we append the menu name at the end of the prompt or something like that. -- Luiz Augusto von Dentz