From 5d5abf352b61a4f6d1ec1c2a770f5ad39b768f4a Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Fri, 22 Nov 2024 11:27:46 +0100 Subject: [PATCH] Prepare interface modularity --- RNS/Reticulum.py | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/RNS/Reticulum.py b/RNS/Reticulum.py index 3dfe2d8..cdb3995 100755 --- a/RNS/Reticulum.py +++ b/RNS/Reticulum.py @@ -550,24 +550,26 @@ class Reticulum: try: def interface_post_init(interface): - if "outgoing" in c and c.as_bool("outgoing") == False: - interface.OUT = False - else: - interface.OUT = True + if interface != None: + if "outgoing" in c and c.as_bool("outgoing") == False: + interface.OUT = False + else: + interface.OUT = True - interface.mode = interface_mode - interface.announce_cap = announce_cap - if configured_bitrate: - interface.bitrate = configured_bitrate - if ifac_size != None: - interface.ifac_size = ifac_size - else: - interface.ifac_size = interface.DEFAULT_IFAC_SIZE + interface.mode = interface_mode + interface.announce_cap = announce_cap + if configured_bitrate: + interface.bitrate = configured_bitrate + if ifac_size != None: + interface.ifac_size = ifac_size + else: + interface.ifac_size = interface.DEFAULT_IFAC_SIZE interface = None if (("interface_enabled" in c) and c.as_bool("interface_enabled") == True) or (("enabled" in c) and c.as_bool("enabled") == True): interface_config = c interface_config["name"] = name + interface_config["selected_interface_mode"] = interface_mode interface_config["configured_bitrate"] = configured_bitrate if c["type"] == "AutoInterface": @@ -1130,6 +1132,14 @@ class Reticulum: return None + def halt_interface(self, interface): + pass + + def resume_interface(self, interface): + pass + + def reload_interface(self, interface): + pass @staticmethod def should_use_implicit_proof():