summaryrefslogtreecommitdiff
path: root/test/test-hfp
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2012-11-26 16:59:34 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2012-11-26 16:59:34 +0200
commit24221371db025e58bcc90e4d3c9f371c2cb3214d (patch)
tree1f2c52519fee07176f4d6df03ed727e9f3e5007f /test/test-hfp
parent6fac519c2c7ed4765969921b0a781848dd43bb60 (diff)
downloadbluez-24221371db025e58bcc90e4d3c9f371c2cb3214d.tar.gz
test: Add RequestDisconnection support to test-hfp
Diffstat (limited to 'test/test-hfp')
-rwxr-xr-xtest/test-hfp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test-hfp b/test/test-hfp
index 1abd11e90..38da076e4 100755
--- a/test/test-hfp
+++ b/test/test-hfp
@@ -61,6 +61,13 @@ class HfpConnection:
features = 0
pending = None
+ def disconnect(self):
+ if (self.fd >= 0):
+ os.close(self.fd)
+ self.fd = -1
+ glib.source_remove(self.io_id)
+ self.io_id = 0
+
def slc_completed(self):
print("SLC establisment complete")
self.slc_complete = True
@@ -164,6 +171,12 @@ class HfpProfile(dbus.service.Object):
print("Cancel")
@dbus.service.method("org.bluez.Profile1",
+ in_signature="o", out_signature="")
+ def RequestDisconnection(self, path):
+ conn = self.conns.pop(path)
+ conn.disconnect()
+
+ @dbus.service.method("org.bluez.Profile1",
in_signature="oha{sv}", out_signature="")
def NewConnection(self, path, fd, properties):
fd = fd.take()