From 28ef64c0721e00780a6276cee33af259c7752c39 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Fri, 15 Jul 2022 14:29:29 +0200 Subject: FSM + State + Python: Add a connecting state and improve back transitions --- wrappers/python/src/__init__.py | 1 + wrappers/python/src/main.py | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'wrappers/python') diff --git a/wrappers/python/src/__init__.py b/wrappers/python/src/__init__.py index a438ed3..802ceec 100644 --- a/wrappers/python/src/__init__.py +++ b/wrappers/python/src/__init__.py @@ -82,6 +82,7 @@ lib.SetSecureLocation.argtypes, lib.SetSecureLocation.restype = [ c_char_p, ], c_void_p lib.SetConnected.argtypes, lib.SetConnected.restype = [c_char_p], c_void_p +lib.SetConnecting.argtypes, lib.SetConnecting.restype = [c_char_p], c_void_p lib.SetDisconnected.argtypes, lib.SetDisconnected.restype = [c_char_p], c_void_p lib.GetIdentifier.argtypes, lib.GetIdentifier.restype = [c_char_p], DataError lib.SetIdentifier.argtypes, lib.SetIdentifier.restype = [c_char_p, c_char_p], c_void_p diff --git a/wrappers/python/src/main.py b/wrappers/python/src/main.py index 84be0ab..008973d 100644 --- a/wrappers/python/src/main.py +++ b/wrappers/python/src/main.py @@ -144,6 +144,12 @@ class EduVPN(object): if connect_err: raise Exception(connect_err) + def set_connecting(self) -> None: + connecting_err = self.go_function(lib.SetConnecting) + + if connecting_err: + raise Exception(connecting_err) + def set_disconnected(self) -> None: disconnect_err = self.go_function(lib.SetDisconnected) -- cgit v1.2.3