summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2010-05-17 17:32:26 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2010-05-17 17:32:26 +0200
commit1e4d4fe0ed499adaf3e61b1e593dccd3c0928158 (patch)
treeb990d40549df8e7609176c7a9b0b024137084d25 /test
parent38a7ef119c1ee1637a4f334dd055b8a171cdf148 (diff)
Add new "Blocked" property to device objects
This patch adds a new "Blocked" property to device objects. It maps directly to the HCIBLOCKDEV and HCIUNBLOCKDEV ioctl's which enable control of incoming connection acceptance on the kernel side.
Diffstat (limited to 'test')
-rwxr-xr-xtest/test-device20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/test-device b/test/test-device
index f8f2d14a..2322122c 100755
--- a/test/test-device
+++ b/test/test-device
@@ -124,5 +124,25 @@ if (sys.argv[1] == "trusted"):
device.SetProperty("Trusted", value)
sys.exit(0)
+if (sys.argv[1] == "blocked"):
+ if (len(sys.argv) < 3):
+ print "Need address parameter"
+ else:
+ path = adapter.FindDevice(sys.argv[2])
+ device = dbus.Interface(bus.get_object("org.bluez", path),
+ "org.bluez.Device")
+ if (len(sys.argv) < 4):
+ properties = device.GetProperties()
+ print properties["Blocked"]
+ else:
+ if (sys.argv[3] == "yes"):
+ value = dbus.Boolean(1)
+ elif (sys.argv[3] == "no"):
+ value = dbus.Boolean(0)
+ else:
+ value = dbus.Boolean(sys.argv[3])
+ device.SetProperty("Blocked", value)
+ sys.exit(0)
+
print "Unknown command"
sys.exit(1)