All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v0] hcitool: Add LE scan based on White List
@ 2012-08-30 16:16 Claudio Takahasi
  2012-09-06 14:33 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Claudio Takahasi @ 2012-08-30 16:16 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Claudio Takahasi

This patch extends the LE scanning command allowing the user to inform
an option to enable LE scanning detecting advertises sent from devices
in the White List Only. This option can be used combined with others.
---
 tools/hcitool.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/hcitool.c b/tools/hcitool.c
index 66e5c20..aefbd68 100644
--- a/tools/hcitool.c
+++ b/tools/hcitool.c
@@ -2487,6 +2487,7 @@ static struct option lescan_options[] = {
 	{ "help",	0, 0, 'h' },
 	{ "privacy",	0, 0, 'p' },
 	{ "passive",	0, 0, 'P' },
+	{ "whitelist",	0, 0, 'w' },
 	{ "discovery",	1, 0, 'd' },
 	{ "duplicates",	0, 0, 'D' },
 	{ 0, 0, 0, 0 }
@@ -2496,6 +2497,7 @@ static const char *lescan_help =
 	"Usage:\n"
 	"\tlescan [--privacy] enable privacy\n"
 	"\tlescan [--passive] set scan type passive (default active)\n"
+	"\tlescan [--whitelist] scan for address in the whitelist only\n"
 	"\tlescan [--discovery=g|l] enable general or limited discovery"
 		"procedure\n"
 	"\tlescan [--duplicates] don't filter duplicates\n";
@@ -2506,6 +2508,7 @@ static void cmd_lescan(int dev_id, int argc, char **argv)
 	uint8_t own_type = 0x00;
 	uint8_t scan_type = 0x01;
 	uint8_t filter_type = 0;
+	uint8_t filter_policy = 0x00;
 	uint16_t interval = htobs(0x0010);
 	uint16_t window = htobs(0x0010);
 	uint8_t filter_dup = 1;
@@ -2518,6 +2521,9 @@ static void cmd_lescan(int dev_id, int argc, char **argv)
 		case 'P':
 			scan_type = 0x00; /* Passive */
 			break;
+		case 'w':
+			filter_policy = 0x01; /* Whitelist */
+			break;
 		case 'd':
 			filter_type = optarg[0];
 			if (filter_type != 'g' && filter_type != 'l') {
@@ -2548,7 +2554,7 @@ static void cmd_lescan(int dev_id, int argc, char **argv)
 	}
 
 	err = hci_le_set_scan_parameters(dd, scan_type, interval, window,
-							own_type, 0x00, 1000);
+						own_type, filter_policy, 1000);
 	if (err < 0) {
 		perror("Set scan parameters failed");
 		exit(1);
-- 
1.7.12


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH BlueZ v0] hcitool: Add LE scan based on White List
  2012-08-30 16:16 [PATCH BlueZ v0] hcitool: Add LE scan based on White List Claudio Takahasi
@ 2012-09-06 14:33 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2012-09-06 14:33 UTC (permalink / raw)
  To: Claudio Takahasi; +Cc: linux-bluetooth

Hi Claudio,

On Thu, Aug 30, 2012, Claudio Takahasi wrote:
> This patch extends the LE scanning command allowing the user to inform
> an option to enable LE scanning detecting advertises sent from devices
> in the White List Only. This option can be used combined with others.
> ---
>  tools/hcitool.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)

Applied. Thanks.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-06 14:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-30 16:16 [PATCH BlueZ v0] hcitool: Add LE scan based on White List Claudio Takahasi
2012-09-06 14:33 ` Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.