linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ville Tervo <ville.tervo@nokia.com>
To: linux-bluetooth@vger.kernel.org
Cc: Ville Tervo <ville.tervo@nokia.com>
Subject: [PATCH] Use default adapter for LE commands
Date: Fri, 16 Jul 2010 13:03:05 +0300	[thread overview]
Message-ID: <1279274585-17730-1-git-send-email-ville.tervo@nokia.com> (raw)

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


             reply	other threads:[~2010-07-16 10:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-16 10:03 Ville Tervo [this message]
2010-07-16 16:54 ` [PATCH] Use default adapter for LE commands Johan Hedberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1279274585-17730-1-git-send-email-ville.tervo@nokia.com \
    --to=ville.tervo@nokia.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).