summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2011-03-02 17:29:27 -0300
committerJohan Hedberg <johan.hedberg@nokia.com>2011-03-04 16:45:28 -0300
commit81a57bd00d4fb91281c014565744c62cfbbec60e (patch)
treef8265b37bace02d192ede3ac0ecfe3084bbbff83 /tools
parent3f6465163dacdb8330e793443bc71b2467bf6696 (diff)
hcitool: add random address type to LE Add to White List
Diffstat (limited to 'tools')
-rw-r--r--tools/hcitool.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/hcitool.c b/tools/hcitool.c
index 3bdd3f58..3e596308 100644
--- a/tools/hcitool.c
+++ b/tools/hcitool.c
@@ -2566,20 +2566,25 @@ static void cmd_lecc(int dev_id, int argc, char **argv)
static struct option lewladd_options[] = {
{ "help", 0, 0, 'h' },
+ { "random", 0, 0, 'r' },
{ 0, 0, 0, 0 }
};
static const char *lewladd_help =
"Usage:\n"
- "\tlewladd <bdaddr>\n";
+ "\tlewladd [--random] <bdaddr>\n";
static void cmd_lewladd(int dev_id, int argc, char **argv)
{
int err, opt, dd;
bdaddr_t bdaddr;
+ uint8_t bdaddr_type = LE_PUBLIC_ADDRESS;
for_each_opt(opt, lewladd_options, NULL) {
switch (opt) {
+ case 'r':
+ bdaddr_type = LE_RANDOM_ADDRESS;
+ break;
default:
printf("%s", lewladd_help);
return;
@@ -2599,7 +2604,7 @@ static void cmd_lewladd(int dev_id, int argc, char **argv)
str2ba(argv[0], &bdaddr);
- err = hci_le_add_white_list(dd, &bdaddr, LE_PUBLIC_ADDRESS, 1000);
+ err = hci_le_add_white_list(dd, &bdaddr, bdaddr_type, 1000);
hci_close_dev(dd);
if (err < 0) {