From: Arman Uguray <armansito@chromium.org>
To: linux-bluetooth@vger.kernel.org
Cc: Arman Uguray <armansito@chromium.org>
Subject: [PATCH 7/7] tools/btmgmt: Add the 'clr-adv' command
Date: Tue, 24 Mar 2015 20:05:54 -0700 [thread overview]
Message-ID: <1427252754-27889-7-git-send-email-armansito@chromium.org> (raw)
In-Reply-To: <1427252754-27889-1-git-send-email-armansito@chromium.org>
This patch introduces the 'clr-adv' command which allows users to remove
all registered advertising instances.
---
tools/btmgmt.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/tools/btmgmt.c b/tools/btmgmt.c
index 54dd0f2..f64327b 100644
--- a/tools/btmgmt.c
+++ b/tools/btmgmt.c
@@ -3955,6 +3955,14 @@ static void cmd_rm_adv(struct mgmt *mgmt, uint16_t index, int argc, char **argv)
}
}
+static void cmd_clr_adv(struct mgmt *mgmt, uint16_t index, int argc, char **argv)
+{
+ char *all_instances = "0";
+ char *rm_argv[] = { "rm-adv", all_instances, NULL };
+
+ cmd_rm_adv(mgmt, index, 2, rm_argv);
+}
+
struct cmd_info {
char *cmd;
void (*func)(struct mgmt *mgmt, uint16_t index, int argc, char **argv);
@@ -4018,8 +4026,9 @@ static struct cmd_info all_cmd[] = {
{ "bredr-oob", cmd_bredr_oob, "Local OOB data (BR/EDR)" },
{ "le-oob", cmd_le_oob, "Local OOB data (LE)" },
{ "advinfo", cmd_advinfo, "Show advertising features" },
- { "add-adv", cmd_add_adv, "Add Advertising Data" },
- { "rm-adv", cmd_rm_adv, "Remove Advertising Data" },
+ { "add-adv", cmd_add_adv, "Add advertising instance" },
+ { "rm-adv", cmd_rm_adv, "Remove advertising instance" },
+ { "clr-adv", cmd_clr_adv, "Clear advertising instances" },
};
static void cmd_quit(struct mgmt *mgmt, uint16_t index,
--
2.2.0.rc0.207.ga3a616c
next prev parent reply other threads:[~2015-03-25 3:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-25 3:05 [PATCH 1/7] lib: Add macros for advertising instance flags Arman Uguray
2015-03-25 3:05 ` [PATCH 2/7] tools/btmgmt: Add --connectable option to add-adv Arman Uguray
2015-03-25 3:05 ` [PATCH 3/7] tools/btmgmt: Add --discoverable " Arman Uguray
2015-03-25 3:05 ` [PATCH 4/7] tools/btmgmt: Add --limited-discov " Arman Uguray
2015-03-25 3:05 ` [PATCH 5/7] tools/btmgmt: Add --managed-flags " Arman Uguray
2015-03-25 3:05 ` [PATCH 6/7] tools/btmgmt: Add --tx-power " Arman Uguray
2015-03-25 3:05 ` Arman Uguray [this message]
2015-03-26 2:29 ` [PATCH 1/7] lib: Add macros for advertising instance flags Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1427252754-27889-7-git-send-email-armansito@chromium.org \
--to=armansito@chromium.org \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox