From 07cefa3c2638b59fa17dc670d8b29806a0b94518 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 28 Aug 2019 10:45:36 +1000 Subject: [PATCH] dbusclient: add the start/stop live from kete to the bindings Signed-off-by: Peter Hutterer --- tuhi/dbusclient.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tuhi/dbusclient.py b/tuhi/dbusclient.py index 762d08a..6ae7c34 100644 --- a/tuhi/dbusclient.py +++ b/tuhi/dbusclient.py @@ -282,6 +282,23 @@ class TuhiDBusClientDevice(_DBusObject): logger.info(f'{self}: Registration successful') self.emit('registered') + def start_live(self, fd): + fd_list = Gio.UnixFDList.new() + fd_list.append(fd) + + res, fds = self.proxy.call_with_unix_fd_list_sync('org.freedesktop.tuhi1.Device.StartLive', + GLib.Variant('(h)', (fd,)), + Gio.DBusCallFlags.NO_AUTO_START, + -1, + fd_list, + None) + if res[0] == 0: + self.live = True + + def stop_live(self): + self.proxy.StopLive() + self.live = False + def terminate(self): try: self.manager.disconnect(self.s1)