linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jaganath Kanakkassery <jaganath.k.os@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
Subject: [PATCH BlueZ v2 06/11] btmgmt: Add support for setting PHY in add-adv
Date: Tue, 24 Apr 2018 19:30:42 +0530	[thread overview]
Message-ID: <1524578447-17347-7-git-send-email-jaganathx.kanakkassery@intel.com> (raw)
In-Reply-To: <1524578447-17347-1-git-send-email-jaganathx.kanakkassery@intel.com>

---
 lib/mgmt.h     |  3 +++
 tools/btmgmt.c | 17 ++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/lib/mgmt.h b/lib/mgmt.h
index 7a25e17..ec6a380 100644
--- a/lib/mgmt.h
+++ b/lib/mgmt.h
@@ -506,6 +506,9 @@ struct mgmt_rp_add_advertising {
 #define MGMT_ADV_FLAG_TX_POWER		(1 << 4)
 #define MGMT_ADV_FLAG_APPEARANCE	(1 << 5)
 #define MGMT_ADV_FLAG_LOCAL_NAME	(1 << 6)
+#define MGMT_ADV_FLAG_SEC_1M		(1 << 7)
+#define MGMT_ADV_FLAG_SEC_2M		(1 << 8)
+#define MGMT_ADV_FLAG_SEC_CODED		(1 << 9)
 
 #define MGMT_OP_REMOVE_ADVERTISING	0x003F
 struct mgmt_cp_remove_advertising {
diff --git a/tools/btmgmt.c b/tools/btmgmt.c
index 750bb44..5f1f587 100755
--- a/tools/btmgmt.c
+++ b/tools/btmgmt.c
@@ -3629,6 +3629,9 @@ static const char *adv_flags_str[] = {
 				"tx-power",
 				"scan-rsp-appearance",
 				"scan-rsp-local-name",
+				"Secondary-channel-1M",
+				"Secondary-channel-2M",
+				"Secondary-channel-CODED",
 };
 
 static const char *adv_flags2str(uint32_t flags)
@@ -3846,6 +3849,7 @@ static void add_adv_usage(void)
 		"\t -s, --scan-rsp <data>     Scan Response Data bytes\n"
 		"\t -t, --timeout <timeout>   Timeout in seconds\n"
 		"\t -D, --duration <duration> Duration in seconds\n"
+		"\t -P, --phy <phy>           Phy type, Specify 1M/2M/CODED\n"
 		"\t -c, --connectable         \"connectable\" flag\n"
 		"\t -g, --general-discov      \"general-discoverable\" flag\n"
 		"\t -l, --limited-discov      \"limited-discoverable\" flag\n"
@@ -3864,6 +3868,7 @@ static struct option add_adv_options[] = {
 	{ "scan-rsp",		1, 0, 's' },
 	{ "timeout",		1, 0, 't' },
 	{ "duration",		1, 0, 'D' },
+	{ "phy",		1, 0, 'P' },
 	{ "connectable",	0, 0, 'c' },
 	{ "general-discov",	0, 0, 'g' },
 	{ "limited-discov",	0, 0, 'l' },
@@ -3932,7 +3937,7 @@ static void cmd_add_adv(int argc, char **argv)
 	uint32_t flags = 0;
 	uint16_t index;
 
-	while ((opt = getopt_long(argc, argv, "+u:d:s:t:D:cglmphna",
+	while ((opt = getopt_long(argc, argv, "+u:d:s:t:D:P:cglmphna",
 						add_adv_options, NULL)) != -1) {
 		switch (opt) {
 		case 'u':
@@ -4017,6 +4022,16 @@ static void cmd_add_adv(int argc, char **argv)
 		case 'a':
 			flags |= MGMT_ADV_FLAG_APPEARANCE;
 			break;
+		case 'P':
+			if (strcasecmp(optarg, "1M") == 0)
+				flags |= MGMT_ADV_FLAG_SEC_1M;
+			else if (strcasecmp(optarg, "2M") == 0)
+				flags |= MGMT_ADV_FLAG_SEC_2M;
+			else if (strcasecmp(optarg, "CODED") == 0)
+				flags |= MGMT_ADV_FLAG_SEC_CODED;
+			else
+				goto done;
+			break;
 		case 'h':
 			success = true;
 			/* fall through */
-- 
2.7.4


  parent reply	other threads:[~2018-04-24 14:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-24 14:00 [PATCH BlueZ v2 00/11] Extended Adv, Scan, Connection and PHY support Jaganath Kanakkassery
2018-04-24 14:00 ` [PATCH BlueZ v2 01/11] doc/mgmt-api: Add support for Set Phy Configuration command Jaganath Kanakkassery
2018-04-24 14:00 ` [PATCH BlueZ v2 02/11] doc/mgmt-api: Add advertising phys support to flags Jaganath Kanakkassery
2018-04-24 14:00 ` [PATCH BlueZ v2 03/11] monitor: Add support PHY management commands and event Jaganath Kanakkassery
2018-04-24 14:00 ` [PATCH BlueZ v2 04/11] btmgmt: Add PHY configuration get/set commands Jaganath Kanakkassery
2018-06-13  8:43   ` Luiz Augusto von Dentz
2018-04-24 14:00 ` [PATCH BlueZ v2 05/11] monitor: Add support for Secondary PHY flags in Add Advertising Jaganath Kanakkassery
2018-04-24 14:00 ` Jaganath Kanakkassery [this message]
2018-04-24 14:00 ` [PATCH BlueZ v2 07/11] emulator: Add 5.0 feature support Jaganath Kanakkassery
2018-06-13  8:19   ` Luiz Augusto von Dentz
2018-04-24 14:00 ` [PATCH BlueZ v2 08/11] mgmt-tester: Add extended advertising test cases Jaganath Kanakkassery
2018-04-24 14:00 ` [PATCH BlueZ v2 09/11] mgmt-tester: Add PHY Configuration " Jaganath Kanakkassery
2018-04-24 14:00 ` [PATCH BlueZ v2 10/11] mgmt-tester: Add tests for extended scanning and device found Jaganath Kanakkassery
2018-04-24 14:00 ` [PATCH BlueZ v2 11/11] mgmt-tester: Add support ext create connection and enh conn complete Jaganath Kanakkassery
2018-06-06  5:50 ` [PATCH BlueZ v2 00/11] Extended Adv, Scan, Connection and PHY support Jaganath K
2018-06-13  8:09   ` Luiz Augusto von Dentz
2018-06-13  8:22     ` Luiz Augusto von Dentz

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=1524578447-17347-7-git-send-email-jaganathx.kanakkassery@intel.com \
    --to=jaganath.k.os@gmail.com \
    --cc=jaganathx.kanakkassery@intel.com \
    --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;
as well as URLs for NNTP newsgroup(s).