summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
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()