linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Use default adapter for LE commands
@ 2010-07-16 10:03 Ville Tervo
  2010-07-16 16:54 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Ville Tervo @ 2010-07-16 10:03 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Ville Tervo

Choose default adapter if device was not specified
on command line.
---
 tools/hcitool.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/tools/hcitool.c b/tools/hcitool.c
index dfb749d..1a53a38 100644
--- a/tools/hcitool.c
+++ b/tools/hcitool.c
@@ -2435,6 +2435,9 @@ static void cmd_lescan(int dev_id, int argc, char **argv)
 		}
 	}
 
+	if (dev_id < 0)
+		dev_id = hci_get_route(NULL);
+
 	dd = hci_open_dev(dev_id);
 	if (dd < 0) {
 		perror("Could not open device");
@@ -2504,6 +2507,9 @@ static void cmd_lecc(int dev_id, int argc, char **argv)
 		return;
 	}
 
+	if (dev_id < 0)
+		dev_id = hci_get_route(NULL);
+
 	dd = hci_open_dev(dev_id);
 	if (dd < 0) {
 		perror("Could not open device");
@@ -2569,6 +2575,9 @@ static void cmd_ledc(int dev_id, int argc, char **argv)
 		return;
 	}
 
+	if (dev_id < 0)
+		dev_id = hci_get_route(NULL);
+
 	dd = hci_open_dev(dev_id);
 	if (dd < 0) {
 		perror("Could not open device");
-- 
1.7.0.1


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

* Re: [PATCH] Use default adapter for LE commands
  2010-07-16 10:03 [PATCH] Use default adapter for LE commands Ville Tervo
@ 2010-07-16 16:54 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2010-07-16 16:54 UTC (permalink / raw)
  To: Ville Tervo; +Cc: linux-bluetooth

Hi Ville,

On Fri, Jul 16, 2010, Ville Tervo wrote:
> Choose default adapter if device was not specified on command line.
> ---
>  tools/hcitool.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)

Thanks for the patch. It's now upstream.

Johan

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

end of thread, other threads:[~2010-07-16 16:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-16 10:03 [PATCH] Use default adapter for LE commands Ville Tervo
2010-07-16 16:54 ` Johan Hedberg

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).