summaryrefslogtreecommitdiff
path: root/wrappers/python/src
diff options
context:
space:
mode:
Diffstat (limited to 'wrappers/python/src')
-rw-r--r--wrappers/python/src/__init__.py2
-rw-r--r--wrappers/python/src/main.py9
-rw-r--r--wrappers/python/src/state.py5
3 files changed, 14 insertions, 2 deletions
diff --git a/wrappers/python/src/__init__.py b/wrappers/python/src/__init__.py
index c0b6679..761adf5 100644
--- a/wrappers/python/src/__init__.py
+++ b/wrappers/python/src/__init__.py
@@ -83,12 +83,14 @@ 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.SetDisconnecting.argtypes, lib.SetDisconnecting.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.SetSearchServer.argtypes, lib.SetSearchServer.restype = [c_char_p], c_void_p
lib.ShouldRenewButton.argtypes, lib.ShouldRenewButton.restype = [], int
lib.RenewSession.argtypes, lib.RenewSession.restype = [c_char_p], c_void_p
lib.FreeString.argtypes, lib.FreeString.restype = [c_void_p], None
+lib.InFSMState.argtypes, lib.InFSMState.restype = [c_void_p, c_int], int
class WrappedError:
diff --git a/wrappers/python/src/main.py b/wrappers/python/src/main.py
index 8440c7d..574d0e2 100644
--- a/wrappers/python/src/main.py
+++ b/wrappers/python/src/main.py
@@ -145,6 +145,12 @@ class EduVPN(object):
if connect_err:
raise Exception(connect_err)
+ def set_disconnecting(self) -> None:
+ disconnecting_err = self.go_function(lib.SetDisconnecting)
+
+ if disconnecting_err:
+ raise Exception(disconnecting_err)
+
def set_connecting(self) -> None:
connecting_err = self.go_function(lib.SetConnecting)
@@ -216,3 +222,6 @@ class EduVPN(object):
def should_renew_button(self) -> bool:
return self.go_function(lib.ShouldRenewButton)
+
+ def in_fsm_state(self, state_id: State) -> bool:
+ return self.go_function(lib.InFSMState, state_id)
diff --git a/wrappers/python/src/state.py b/wrappers/python/src/state.py
index cd5bd90..a4b11a8 100644
--- a/wrappers/python/src/state.py
+++ b/wrappers/python/src/state.py
@@ -19,5 +19,6 @@ class State(IntEnum):
REQUEST_CONFIG = 8
ASK_PROFILE = 9
HAS_CONFIG = 10
- CONNECTING = 11
- CONNECTED = 12
+ DISCONNECTING = 11
+ CONNECTING = 12
+ CONNECTED = 13