* [PATCH] Bluetooth: hcitool: add bdaddr type option to lecc
@ 2011-02-10 5:48 Emeltchenko Andrei
0 siblings, 0 replies; 3+ messages in thread
From: Emeltchenko Andrei @ 2011-02-10 5:48 UTC (permalink / raw)
To: linux-bluetooth
From: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
---
tools/hcitool.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/tools/hcitool.c b/tools/hcitool.c
index 536d407..c097526 100644
--- a/tools/hcitool.c
+++ b/tools/hcitool.c
@@ -2420,7 +2420,7 @@ static struct option lecc_options[] = {
static const char *lecc_help =
"Usage:\n"
- "\tlecc <bdaddr>\n";
+ "\tlecc <bdaddr> [conn type]\n";
static void cmd_lecc(int dev_id, int argc, char **argv)
{
@@ -2437,7 +2437,7 @@ static void cmd_lecc(int dev_id, int argc, char **argv)
return;
}
}
- helper_arg(1, 1, &argc, &argv, lecc_help);
+ helper_arg(1, 2, &argc, &argv, lecc_help);
if (dev_id < 0)
dev_id = hci_get_route(NULL);
@@ -2450,10 +2450,14 @@ static void cmd_lecc(int dev_id, int argc, char **argv)
str2ba(argv[0], &bdaddr);
+ if (argc == 2)
+ peer_bdaddr_type = atoi(argv[1]);
+ else
+ peer_bdaddr_type = 0;
+
interval = htobs(0x0004);
window = htobs(0x0004);
initiator_filter = 0x00;
- peer_bdaddr_type = 0x00;
own_bdaddr_type = 0x00;
min_interval = htobs(0x000F);
max_interval = htobs(0x000F);
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH] Bluetooth: hcitool: add bdaddr type option to lecc
@ 2011-02-10 0:59 Emeltchenko Andrei
2011-02-11 11:14 ` Anderson Lizardo
0 siblings, 1 reply; 3+ messages in thread
From: Emeltchenko Andrei @ 2011-02-10 0:59 UTC (permalink / raw)
To: linux-bluetooth
From: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
---
tools/hcitool.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/tools/hcitool.c b/tools/hcitool.c
index 536d407..c097526 100644
--- a/tools/hcitool.c
+++ b/tools/hcitool.c
@@ -2420,7 +2420,7 @@ static struct option lecc_options[] = {
static const char *lecc_help =
"Usage:\n"
- "\tlecc <bdaddr>\n";
+ "\tlecc <bdaddr> [conn type]\n";
static void cmd_lecc(int dev_id, int argc, char **argv)
{
@@ -2437,7 +2437,7 @@ static void cmd_lecc(int dev_id, int argc, char **argv)
return;
}
}
- helper_arg(1, 1, &argc, &argv, lecc_help);
+ helper_arg(1, 2, &argc, &argv, lecc_help);
if (dev_id < 0)
dev_id = hci_get_route(NULL);
@@ -2450,10 +2450,14 @@ static void cmd_lecc(int dev_id, int argc, char **argv)
str2ba(argv[0], &bdaddr);
+ if (argc == 2)
+ peer_bdaddr_type = atoi(argv[1]);
+ else
+ peer_bdaddr_type = 0;
+
interval = htobs(0x0004);
window = htobs(0x0004);
initiator_filter = 0x00;
- peer_bdaddr_type = 0x00;
own_bdaddr_type = 0x00;
min_interval = htobs(0x000F);
max_interval = htobs(0x000F);
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] Bluetooth: hcitool: add bdaddr type option to lecc
2011-02-10 0:59 Emeltchenko Andrei
@ 2011-02-11 11:14 ` Anderson Lizardo
0 siblings, 0 replies; 3+ messages in thread
From: Anderson Lizardo @ 2011-02-11 11:14 UTC (permalink / raw)
To: Emeltchenko Andrei; +Cc: linux-bluetooth
Hi Andrei,
On Wed, Feb 9, 2011 at 9:59 PM, Emeltchenko Andrei
<Andrei.Emeltchenko.news@gmail.com> wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
>
> ---
> tools/hcitool.c | 10 +++++++---
> 1 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/tools/hcitool.c b/tools/hcitool.c
> index 536d407..c097526 100644
> --- a/tools/hcitool.c
> +++ b/tools/hcitool.c
> @@ -2420,7 +2420,7 @@ static struct option lecc_options[] = {
>
> static const char *lecc_help =
> "Usage:\n"
> - "\tlecc <bdaddr>\n";
> + "\tlecc <bdaddr> [conn type]\n";
Actually it would be "[bdaddr type]", right?
But I still think we should have a --random boolean option that sets
the bdaddr type to 0x01 if it is TRUE, FALSE otherwise. Other values
are RFU.
>
> static void cmd_lecc(int dev_id, int argc, char **argv)
> {
> @@ -2437,7 +2437,7 @@ static void cmd_lecc(int dev_id, int argc, char **argv)
> return;
> }
> }
> - helper_arg(1, 1, &argc, &argv, lecc_help);
> + helper_arg(1, 2, &argc, &argv, lecc_help);
>
> if (dev_id < 0)
> dev_id = hci_get_route(NULL);
> @@ -2450,10 +2450,14 @@ static void cmd_lecc(int dev_id, int argc, char **argv)
>
> str2ba(argv[0], &bdaddr);
>
> + if (argc == 2)
> + peer_bdaddr_type = atoi(argv[1]);
> + else
> + peer_bdaddr_type = 0;
> +
Note you are not validating values here as in your other patch.
> interval = htobs(0x0004);
> window = htobs(0x0004);
> initiator_filter = 0x00;
> - peer_bdaddr_type = 0x00;
> own_bdaddr_type = 0x00;
> min_interval = htobs(0x000F);
> max_interval = htobs(0x000F);
> --
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
Regards,
--
Anderson Lizardo
OpenBossa Labs - INdT
Manaus - Brazil
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-02-11 11:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-10 5:48 [PATCH] Bluetooth: hcitool: add bdaddr type option to lecc Emeltchenko Andrei
-- strict thread matches above, loose matches on Subject: below --
2011-02-10 0:59 Emeltchenko Andrei
2011-02-11 11:14 ` Anderson Lizardo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox