summaryrefslogtreecommitdiff
path: root/test/test-device
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2010-12-21 11:22:57 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2010-12-21 11:23:30 +0200
commitdd109a698c149a805f19cd2a7ddd0cbb8434f965 (patch)
tree3f6dfff873cb4e580397501da3901902887ba47b /test/test-device
parented2c65ad9d540c7e984b63579a9180e66f3e6bb0 (diff)
downloadbluez-dd109a698c149a805f19cd2a7ddd0cbb8434f965.tar.gz
Add disconnect command to test-device
Diffstat (limited to 'test/test-device')
-rwxr-xr-xtest/test-device11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test-device b/test/test-device
index 828349ce4..06d7c46bf 100755
--- a/test/test-device
+++ b/test/test-device
@@ -36,6 +36,7 @@ if (len(args) < 1):
print " list"
print " create <address>"
print " remove <address|path>"
+ print " disconnect <address>"
print " discover <address> [pattern]"
print " class <address>"
print " name <address>"
@@ -83,6 +84,16 @@ if (args[0] == "remove"):
adapter.RemoveDevice(path)
sys.exit(0)
+if (args[0] == "disconnect"):
+ if (len(args) < 2):
+ print "Need address parameter"
+ else:
+ path = adapter.FindDevice(args[1])
+ device = dbus.Interface(bus.get_object("org.bluez", path),
+ "org.bluez.Device")
+ device.Disconnect()
+ sys.exit(0)
+
if (args[0] == "discover"):
if (len(args) < 2):
print "Need address parameter"