test: Add RequestDisconnection support to test-hfp
diff --git a/test/test-hfp b/test/test-hfp
index 1abd11e..38da076 100755
--- a/test/test-hfp
+++ b/test/test-hfp
@@ -61,6 +61,13 @@
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 @@
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()