linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH v3 5/8] client: Print AD Data and Discoverable once registered
Date: Tue, 22 May 2018 12:50:08 +0300	[thread overview]
Message-ID: <20180522095011.517-5-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20180522095011.517-1-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This prints both Data and Discoverable if advertise command succeeds:

[bluetooth]# advertise.data 0x26 0x01 0x00
[bluetooth]# advertise.discoverable on
[bluetooth]# advertise on
Advertising object registered
Data Type: 0x26
  01 00                                            ..
Tx Power: off
Name: off
Apperance: off
Discoverable: on
---
 client/advertising.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/client/advertising.c b/client/advertising.c
index cb0ca4a57..8abf4785b 100644
--- a/client/advertising.c
+++ b/client/advertising.c
@@ -164,6 +164,11 @@ static void print_ad(void)
 						ad.manufacturer.data.len);
 	}
 
+	if (ad.data.data.len) {
+		bt_shell_printf("Data Type: 0x%02x\n", ad.data.type);
+		bt_shell_hexdump(ad.data.data.data, ad.data.data.len);
+	}
+
 	bt_shell_printf("Tx Power: %s\n", ad.tx_power ? "on" : "off");
 
 	if (ad.local_name)
@@ -179,6 +184,8 @@ static void print_ad(void)
 		bt_shell_printf("Apperance: %s\n",
 					ad.appearance ? "on" : "off");
 
+	bt_shell_printf("Discoverable: %s\n", ad.discoverable ? "on": "off");
+
 	if (ad.duration)
 		bt_shell_printf("Duration: %u sec\n", ad.duration);
 
-- 
2.14.3


  parent reply	other threads:[~2018-05-22  9:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-22  9:50 [PATCH v3 1/8] doc/advertising-api: Add Discoverable property Luiz Augusto von Dentz
2018-05-22  9:50 ` [PATCH v3 2/8] shared/ad: Add function to manipulate flags Luiz Augusto von Dentz
2018-05-22  9:50 ` [PATCH v3 3/8] advertising: Add implementation of Discoverable property Luiz Augusto von Dentz
2018-05-22  9:50 ` [PATCH v3 4/8] client: Add advertise.discoverable command Luiz Augusto von Dentz
2018-05-22  9:50 ` Luiz Augusto von Dentz [this message]
2018-05-22  9:50 ` [PATCH v3 6/8] doc/advertising-api: Add DiscoverableTimeout property Luiz Augusto von Dentz
2018-05-22  9:50 ` [PATCH v3 7/8] advertising: Add implementation of " Luiz Augusto von Dentz
2018-05-22  9:50 ` [PATCH v3 8/8] client: Add advertise.discoverable-timeout command Luiz Augusto von Dentz
2018-05-22 10:25 ` [PATCH v3 1/8] doc/advertising-api: Add Discoverable property David Llewellyn-Jones
2018-05-22 10:45   ` Luiz Augusto von Dentz
2018-05-22 10:52     ` David Llewellyn-Jones
2018-05-24 11:05       ` 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=20180522095011.517-5-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.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).