summaryrefslogtreecommitdiff
path: root/test/test-adapter
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>2011-08-16 18:58:52 -0300
committerJohan Hedberg <johan.hedberg@intel.com>2011-08-22 13:13:23 +0300
commit319f66f7c8aa25673f8332eb2876d2efa4f14464 (patch)
tree48c69364db2cdf0640aff4ad04a6a5fe4b53bed5 /test/test-adapter
parent84f4d71d7de54561e44cd48c1fa28a9f370224af (diff)
downloadbluez-319f66f7c8aa25673f8332eb2876d2efa4f14464.tar.gz
Add support for listing all adapters using test-adapter
Diffstat (limited to 'test/test-adapter')
-rwxr-xr-xtest/test-adapter17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test-adapter b/test/test-adapter
index 00ef6f5d2..762ef980d 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()