From: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
To: linux-bluetooth@vger.kernel.org
Cc: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Subject: [PATCH BlueZ] Add support for listing all adapters using test-adapter
Date: Tue, 16 Aug 2011 18:58:52 -0300 [thread overview]
Message-ID: <1313531932-10944-1-git-send-email-vinicius.gomes@openbossa.org> (raw)
---
test/test-adapter | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/test/test-adapter b/test/test-adapter
index 00ef6f5..33bdd47 100755
--- a/test/test-adapter
+++ b/test/test-adapter
@@ -29,6 +29,7 @@ if (len(args) < 1):
print "Usage: %s <command>" % (sys.argv[0])
print ""
print " address"
+ print " list"
print " name [name]"
print " powered [on/off]"
print " pairable [on/off]"
@@ -51,6 +52,22 @@ if (args[0] == "name"):
adapter.SetProperty("Name", args[1])
sys.exit(0)
+if (args[0] == "list"):
+ if (len(args) < 2):
+ properties = manager.GetProperties()
+ for adapter_path in properties["Adapters"]:
+ adapter = dbus.Interface(bus.get_object("org.bluez", adapter_path),
+ "org.bluez.Adapter")
+ prop = adapter.GetProperties()
+ print " [ %s ]" % (adapter_path)
+ for (key, value) in prop.iteritems():
+ if (key == "Class"):
+ print " %s = 0x%06x" % (key, value)
+ else:
+ print " %s = %s" % (key, value)
+ print
+ sys.exit(0)
+
if (args[0] == "powered"):
if (len(args) < 2):
properties = adapter.GetProperties()
--
1.7.6
next reply other threads:[~2011-08-16 21:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-16 21:58 Vinicius Costa Gomes [this message]
2011-08-22 10:13 ` [PATCH BlueZ] Add support for listing all adapters using test-adapter 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=1313531932-10944-1-git-send-email-vinicius.gomes@openbossa.org \
--to=vinicius.gomes@openbossa.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.