All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] Add support for listing all adapters using test-adapter
@ 2011-08-16 21:58 Vinicius Costa Gomes
  2011-08-22 10:13 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Vinicius Costa Gomes @ 2011-08-16 21:58 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Vinicius Costa Gomes

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


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

* Re: [PATCH BlueZ] Add support for listing all adapters using test-adapter
  2011-08-16 21:58 [PATCH BlueZ] Add support for listing all adapters using test-adapter Vinicius Costa Gomes
@ 2011-08-22 10:13 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2011-08-22 10:13 UTC (permalink / raw)
  To: Vinicius Costa Gomes; +Cc: linux-bluetooth

Hi Vinicius,

On Tue, Aug 16, 2011, Vinicius Costa Gomes wrote:
> ---
>  test/test-adapter |   17 +++++++++++++++++
>  1 files changed, 17 insertions(+), 0 deletions(-)

Applied. Thanks.

Johan

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

end of thread, other threads:[~2011-08-22 10:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-16 21:58 [PATCH BlueZ] Add support for listing all adapters using test-adapter Vinicius Costa Gomes
2011-08-22 10:13 ` Johan Hedberg

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.