From 26e3ca4f2beca7366a812b25f57e1033e6c23b96 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sun, 23 Aug 2026 10:46:21 +0200 Subject: [PATCH] Added shared medium hints to interfaces --- RNS/Interfaces/AX25KISSInterface.py | 1 + RNS/Interfaces/Android/KISSInterface.py | 1 + RNS/Interfaces/Android/RNodeInterface.py | 10 ++++------ RNS/Interfaces/Android/SerialInterface.py | 1 + RNS/Interfaces/Interface.py | 1 + RNS/Interfaces/KISSInterface.py | 1 + RNS/Interfaces/PipeInterface.py | 1 + RNS/Interfaces/RNodeInterface.py | 1 + RNS/Interfaces/RNodeMultiInterface.py | 1 + RNS/Interfaces/SerialInterface.py | 1 + RNS/Interfaces/UDPInterface.py | 1 + 11 files changed, 14 insertions(+), 6 deletions(-) diff --git a/RNS/Interfaces/AX25KISSInterface.py b/RNS/Interfaces/AX25KISSInterface.py index abda34fe..032b42ae 100644 --- a/RNS/Interfaces/AX25KISSInterface.py +++ b/RNS/Interfaces/AX25KISSInterface.py @@ -128,6 +128,7 @@ class AX25KISSInterface(Interface): self.packet_queue = [] self.flow_control = flow_control + self.shared_medium = True self.interface_ready = False self.flow_control_timeout = 5 self.flow_control_locked = time.time() diff --git a/RNS/Interfaces/Android/KISSInterface.py b/RNS/Interfaces/Android/KISSInterface.py index b14f45c6..6ba32099 100644 --- a/RNS/Interfaces/Android/KISSInterface.py +++ b/RNS/Interfaces/Android/KISSInterface.py @@ -131,6 +131,7 @@ class KISSInterface(Interface): self.packet_queue = [] self.flow_control = flow_control + self.shared_medium = True self.interface_ready = False self.flow_control_timeout = 5 self.flow_control_locked = time.time() diff --git a/RNS/Interfaces/Android/RNodeInterface.py b/RNS/Interfaces/Android/RNodeInterface.py index ed2e9d47..5d8b19f0 100644 --- a/RNS/Interfaces/Android/RNodeInterface.py +++ b/RNS/Interfaces/Android/RNodeInterface.py @@ -282,12 +282,9 @@ class RNodeInterface(Interface): if (port != None or device_serial != None) and (enable_bluetooth or disable_bluetooth or pairing_mode): serial = None bluetooth_state = None - if pairing_mode: - bluetooth_state = 0x01 - elif enable_bluetooth: - bluetooth_state = 0x01 - elif disable_bluetooth: - bluetooth_state = 0x00 + if pairing_mode: bluetooth_state = 0x01 + elif enable_bluetooth: bluetooth_state = 0x01 + elif disable_bluetooth: bluetooth_state = 0x00 if port != None: RNS.log("Opening serial port "+port+"...") @@ -518,6 +515,7 @@ class RNodeInterface(Interface): self.packet_queue = [] self.flow_control = flow_control + self.shared_medium = True self.interface_ready = False self.announce_rate_target = None self.last_port_io = 0 diff --git a/RNS/Interfaces/Android/SerialInterface.py b/RNS/Interfaces/Android/SerialInterface.py index 2e0cb177..088b41fc 100644 --- a/RNS/Interfaces/Android/SerialInterface.py +++ b/RNS/Interfaces/Android/SerialInterface.py @@ -95,6 +95,7 @@ class SerialInterface(Interface): raise ValueError("No port specified for serial interface") self.HW_MTU = 564 + self.shared_medium = True self.pyserial = serial self.serial = None diff --git a/RNS/Interfaces/Interface.py b/RNS/Interfaces/Interface.py index 525607a1..88f25c9c 100755 --- a/RNS/Interfaces/Interface.py +++ b/RNS/Interfaces/Interface.py @@ -126,6 +126,7 @@ class Interface: self.tunnel_id = None self.ingress_control = True self.phy_keepalive = False + self.shared_medium = False self.ic_burst_active = False self.ic_burst_activated = 0 diff --git a/RNS/Interfaces/KISSInterface.py b/RNS/Interfaces/KISSInterface.py index d343f0a3..036904e4 100644 --- a/RNS/Interfaces/KISSInterface.py +++ b/RNS/Interfaces/KISSInterface.py @@ -122,6 +122,7 @@ class KISSInterface(Interface): self.packet_queue = [] self.flow_control = flow_control + self.shared_medium = True self.interface_ready = False self.flow_control_timeout = 5 self.flow_control_locked = time.time() diff --git a/RNS/Interfaces/PipeInterface.py b/RNS/Interfaces/PipeInterface.py index 1574753c..6b420aa5 100644 --- a/RNS/Interfaces/PipeInterface.py +++ b/RNS/Interfaces/PipeInterface.py @@ -84,6 +84,7 @@ class PipeInterface(Interface): self.pipe_is_open = False self.bitrate = PipeInterface.BITRATE_GUESS self.respawn_delay = respawn_delay + self.shared_medium = True try: self.open_pipe() diff --git a/RNS/Interfaces/RNodeInterface.py b/RNS/Interfaces/RNodeInterface.py index 12cdbd46..ed57cc48 100644 --- a/RNS/Interfaces/RNodeInterface.py +++ b/RNS/Interfaces/RNodeInterface.py @@ -294,6 +294,7 @@ class RNodeInterface(Interface): self.packet_queue = [] self.flow_control = flow_control + self.shared_medium = True self.interface_ready = False self.announce_rate_target = None self.supports_discovery = True diff --git a/RNS/Interfaces/RNodeMultiInterface.py b/RNS/Interfaces/RNodeMultiInterface.py index 1ed8e772..424394f4 100644 --- a/RNS/Interfaces/RNodeMultiInterface.py +++ b/RNS/Interfaces/RNodeMultiInterface.py @@ -1001,6 +1001,7 @@ class RNodeSubInterface(Interface): self.r_premable_time_ms = None self.packet_queue = [] + self.shared_medium = True self.interface_ready = False self.parent_interface = parent_interface self.announce_rate_target = None diff --git a/RNS/Interfaces/SerialInterface.py b/RNS/Interfaces/SerialInterface.py index 7c9d0da7..0bce146f 100755 --- a/RNS/Interfaces/SerialInterface.py +++ b/RNS/Interfaces/SerialInterface.py @@ -83,6 +83,7 @@ class SerialInterface(Interface): raise ValueError("No port specified for serial interface") self.HW_MTU = 564 + self.shared_medium = True self.pyserial = serial self.serial = None diff --git a/RNS/Interfaces/UDPInterface.py b/RNS/Interfaces/UDPInterface.py index 8966bbe5..8dd9c78e 100644 --- a/RNS/Interfaces/UDPInterface.py +++ b/RNS/Interfaces/UDPInterface.py @@ -78,6 +78,7 @@ class UDPInterface(Interface): self.name = name self.online = False self.bitrate = UDPInterface.BITRATE_GUESS + self.shared_medium = True if device != None: if bindip == None: