Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp391384ybg; Tue, 22 Oct 2019 23:04:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYXKXjDgBG6t8r5CL4cFGVm0JkdpQiDsXF+7V+yDgvFs61HIJvaBFzPnGP+86GKwWeeF3v X-Received: by 2002:a17:906:2d49:: with SMTP id e9mr30983912eji.240.1571810678662; Tue, 22 Oct 2019 23:04:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571810678; cv=none; d=google.com; s=arc-20160816; b=XZ9oiFnxTIxSaWLy1r7yAcyREKhDs2whnW3MRl9zHGCMpNkradKYWuEIFVjrmXOmZ+ Qj/lhPRpPnAvvfECDabcdoVPL5z6ArNTHfNnmj9m/XX88Naokg82zHOSOK7OKG/YHz0G bgiTxXHcEmHjn4SizT0vS2TuygAdgXP7YvXv4z0egsnhnB5swAa+AkyFZl64ej1JWRTf WSdMc8KGMGp+2qc9oAf36cvGilygUAcXMI7uioZS0W9PvToLgY9lJ0cVE8ZHACydgIsZ RtX82bRXi/sLxYFDCFPGh3rrPFXWF3AaxsDkfoZhcARwECH5yysjr1EkQkMU/q5UPjqF hFKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=HZ/xcTo4zI45tW92R5dGBKcHD2sEakNHQOY0s0sc0dw=; b=nMCmGZ/gAY4yxxTxOOFyf2t1l2hGDfm8j3uCebiCzrsSZumQIPBZbDC8biBQismE3z cLVScSO3N9Lkrb5eYNDXn8p+v/rX0IAX8pY+TPm3ResE2xkLdUugB1ecetwQu3y7w4XG 6mzNn6ZxydpjkecMXQZl7TBLR22A4FK4I+T1TJS7eORke9xkMV2tOy9uHkSj9rSmr9+7 n/VNySqx/Lbmip5KY87tifJJ9IzQwIlaV0l+Jj4aJkl44nXlNx/oBQQzf2OY30TTYT35 aIJzA8fNjjsMofOZrD5fEVWSOsGqhdUqHg2s+IPl8RHnd+Tl1a5Gw1yU1WAJzO8UQ3ME bFrQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r8si13123694edm.158.2019.10.22.23.03.57; Tue, 22 Oct 2019 23:04:38 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730597AbfJWFlV (ORCPT + 99 others); Wed, 23 Oct 2019 01:41:21 -0400 Received: from mga04.intel.com ([192.55.52.120]:29048 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727885AbfJWFlV (ORCPT ); Wed, 23 Oct 2019 01:41:21 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Oct 2019 22:41:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,219,1569308400"; d="scan'208";a="203863305" Received: from afignato-mobl1.amr.corp.intel.com (HELO ingas-nuc1.sea.intel.com) ([10.252.128.87]) by FMSMGA003.fm.intel.com with ESMTP; 22 Oct 2019 22:41:21 -0700 From: Inga Stotland To: linux-bluetooth@vger.kernel.org Cc: luiz.dentz@gmail.com, Inga Stotland Subject: [PATCH BlueZ] shared/shell: Add prompt item to bt_shell_menu structure Date: Tue, 22 Oct 2019 22:41:19 -0700 Message-Id: <20191023054119.7712-1-inga.stotland@intel.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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[]; }; -- 2.21.0