summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-11-29 16:09:21 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2008-11-29 16:09:21 +0200
commit8e7a46183e4f251f2b62876eaefe066603dda1aa (patch)
tree4858639968c789728e874295bc3074cb1f052d97 /test
parentc78f35d9bfce3ec17648882905466d367ba1f001 (diff)
Add support for Powered property to test-adapter
Diffstat (limited to 'test')
-rwxr-xr-xtest/test-adapter15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test-adapter b/test/test-adapter
index 939739d9..4c1a28ad 100755
--- a/test/test-adapter
+++ b/test/test-adapter
@@ -16,6 +16,7 @@ if (len(sys.argv) < 2):
print ""
print " address"
print " name [name]"
+ print " powered [on/off]"
print " pairable [on/off]"
print " pairabletimeout [timeout]"
print " discoverable [on/off]"
@@ -36,6 +37,20 @@ if (sys.argv[1] == "name"):
adapter.SetProperty("Name", sys.argv[2])
sys.exit(0)
+if (sys.argv[1] == "powered"):
+ if (len(sys.argv) < 3):
+ properties = adapter.GetProperties()
+ print properties["Powered"]
+ else:
+ if (sys.argv[2] == "on"):
+ value = dbus.Boolean(1)
+ elif (sys.argv[2] == "off"):
+ value = dbus.Boolean(0)
+ else:
+ value = dbus.Boolean(sys.argv[2])
+ adapter.SetProperty("Powered", value)
+ sys.exit(0)
+
if (sys.argv[1] == "pairable"):
if (len(sys.argv) < 3):
properties = adapter.GetProperties()