From fd0753c5463b4c54d09712336301e174f05e05ab Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Mon, 9 May 2022 14:15:59 +0200 Subject: State: Implement SetDisconnected/SetConnected --- wrappers/python/src/main.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'wrappers/python/src/main.py') diff --git a/wrappers/python/src/main.py b/wrappers/python/src/main.py index 5474ade..9c2fb41 100644 --- a/wrappers/python/src/main.py +++ b/wrappers/python/src/main.py @@ -43,6 +43,18 @@ def Connect(name, url): data_error = lib.Connect(name_bytes, url_bytes) return GetDataError(data_error) +def SetConnected(name): + name_bytes = name.encode("utf-8") + ptr_err = lib.SetConnected(name_bytes) + err_string = GetPtrString(ptr_err) + return err_string + +def SetDisconnected(name): + name_bytes = name.encode("utf-8") + ptr_err = lib.SetDisconnected(name_bytes) + err_string = GetPtrString(ptr_err) + return err_string + # This has to be global as otherwise the callback is not alive callback_function = None @@ -85,6 +97,11 @@ class EduVPN(object): def connect(self, url): return Connect(self.name, url) + def set_disconnected(self): + return SetDisconnected(self.name) + + def set_connected(self): + return SetConnected(self.name) @property def event(self): -- cgit v1.2.3