summaryrefslogtreecommitdiff
path: root/tools/hcitool.c
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@nokia.com>2011-02-11 09:23:44 -0800
committerJohan Hedberg <johan.hedberg@nokia.com>2011-02-11 13:41:28 -0800
commit2cc99a5ea6f13839fe6fbfd3bf4a761cdcedce50 (patch)
treebe7e745251a21d82d9ac31980bb7258a37ee4d4f /tools/hcitool.c
parentef4ee198951e5d5596bfe9cecf67451584d78edd (diff)
downloadbluez-2cc99a5ea6f13839fe6fbfd3bf4a761cdcedce50.tar.gz
Bluetooth: hcitool: add option for LE_Scan_Type parameter
The LE_Scan_Type parameter controls the type of scan to perform.
Diffstat (limited to 'tools/hcitool.c')
-rw-r--r--tools/hcitool.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/hcitool.c b/tools/hcitool.c
index 536d40761..6883b2832 100644
--- a/tools/hcitool.c
+++ b/tools/hcitool.c
@@ -2350,23 +2350,29 @@ done:
static struct option lescan_options[] = {
{ "help", 0, 0, 'h' },
{ "privacy", 0, 0, 'p' },
+ { "passive", 0, 0, 'P' },
{ 0, 0, 0, 0 }
};
static const char *lescan_help =
"Usage:\n"
- "\tlescan [--privacy] enable privacy\n";
+ "\tlescan [--privacy] enable privacy\n"
+ "\tlescan [--passive] set scan type passive (default active)\n";
static void cmd_lescan(int dev_id, int argc, char **argv)
{
int err, opt, dd;
uint8_t own_type = 0x00;
+ uint8_t scan_type = 0x01;
for_each_opt(opt, lescan_options, NULL) {
switch (opt) {
case 'p':
own_type = 0x01; /* Random */
break;
+ case 'P':
+ scan_type = 0x00; /* Passive */
+ break;
default:
printf("%s", lescan_help);
return;
@@ -2383,7 +2389,7 @@ static void cmd_lescan(int dev_id, int argc, char **argv)
exit(1);
}
- err = hci_le_set_scan_parameters(dd, 0x01, htobs(0x0010),
+ err = hci_le_set_scan_parameters(dd, scan_type, htobs(0x0010),
htobs(0x0010), own_type, 0x00);
if (err < 0) {
perror("Set scan parameters failed");