From 36c761e8ddc1be1d6166b9139293bfd7626402c4 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Fri, 22 Nov 2024 14:12:55 +0100 Subject: [PATCH] Refactored processOutgoing to process_outgoing --- RNS/Interfaces/AX25KISSInterface.py | 4 ++-- RNS/Interfaces/Android/KISSInterface.py | 6 +++--- RNS/Interfaces/Android/RNodeInterface.py | 6 +++--- RNS/Interfaces/Android/SerialInterface.py | 2 +- RNS/Interfaces/AutoInterface.py | 2 +- RNS/Interfaces/I2PInterface.py | 4 ++-- RNS/Interfaces/Interface.py | 2 +- RNS/Interfaces/KISSInterface.py | 6 +++--- RNS/Interfaces/LocalInterface.py | 4 ++-- RNS/Interfaces/PipeInterface.py | 2 +- RNS/Interfaces/RNodeInterface.py | 6 +++--- RNS/Interfaces/RNodeMultiInterface.py | 10 +++++----- RNS/Interfaces/SerialInterface.py | 2 +- RNS/Interfaces/TCPInterface.py | 4 ++-- RNS/Interfaces/UDPInterface.py | 2 +- RNS/Transport.py | 4 ++-- 16 files changed, 33 insertions(+), 33 deletions(-) diff --git a/RNS/Interfaces/AX25KISSInterface.py b/RNS/Interfaces/AX25KISSInterface.py index 04acb89..b8a5f04 100644 --- a/RNS/Interfaces/AX25KISSInterface.py +++ b/RNS/Interfaces/AX25KISSInterface.py @@ -251,7 +251,7 @@ class AX25KISSInterface(Interface): self.owner.inbound(data[AX25.HEADER_SIZE:], self) - def processOutgoing(self,data): + def process_outgoing(self,data): datalen = len(data) if self.online: if self.interface_ready: @@ -301,7 +301,7 @@ class AX25KISSInterface(Interface): if len(self.packet_queue) > 0: data = self.packet_queue.pop(0) self.interface_ready = True - self.processOutgoing(data) + self.process_outgoing(data) elif len(self.packet_queue) == 0: self.interface_ready = True diff --git a/RNS/Interfaces/Android/KISSInterface.py b/RNS/Interfaces/Android/KISSInterface.py index fd72262..8d22dc1 100644 --- a/RNS/Interfaces/Android/KISSInterface.py +++ b/RNS/Interfaces/Android/KISSInterface.py @@ -289,7 +289,7 @@ class KISSInterface(Interface): self.owner.inbound(data, self) threading.Thread(target=af, daemon=True).start() - def processOutgoing(self,data): + def process_outgoing(self,data): datalen = len(data) if self.online: if self.interface_ready: @@ -323,7 +323,7 @@ class KISSInterface(Interface): if len(self.packet_queue) > 0: data = self.packet_queue.pop(0) self.interface_ready = True - self.processOutgoing(data) + self.process_outgoing(data) elif len(self.packet_queue) == 0: self.interface_ready = True @@ -395,7 +395,7 @@ class KISSInterface(Interface): while len(frame) < 15: frame.append(0x00) - self.processOutgoing(bytes(frame)) + self.process_outgoing(bytes(frame)) except Exception as e: self.online = False diff --git a/RNS/Interfaces/Android/RNodeInterface.py b/RNS/Interfaces/Android/RNodeInterface.py index c4c0808..2d7d388 100644 --- a/RNS/Interfaces/Android/RNodeInterface.py +++ b/RNS/Interfaces/Android/RNodeInterface.py @@ -965,7 +965,7 @@ class RNodeInterface(Interface): threading.Thread(target=af, daemon=True).start() - def processOutgoing(self,data): + def process_outgoing(self,data): datalen = len(data) if self.online: if self.interface_ready: @@ -996,7 +996,7 @@ class RNodeInterface(Interface): if len(self.packet_queue) > 0: data = self.packet_queue.pop(0) self.interface_ready = True - self.processOutgoing(data) + self.process_outgoing(data) elif len(self.packet_queue) == 0: self.interface_ready = True @@ -1304,7 +1304,7 @@ class RNodeInterface(Interface): if self.first_tx != None: if time.time() > self.first_tx + self.id_interval: RNS.log("Interface "+str(self)+" is transmitting beacon data: "+str(self.id_callsign.decode("utf-8")), RNS.LOG_DEBUG) - self.processOutgoing(self.id_callsign) + self.process_outgoing(self.id_callsign) if (time.time() - self.last_port_io > self.port_io_timeout): self.detect() diff --git a/RNS/Interfaces/Android/SerialInterface.py b/RNS/Interfaces/Android/SerialInterface.py index 048cd33..3307eea 100644 --- a/RNS/Interfaces/Android/SerialInterface.py +++ b/RNS/Interfaces/Android/SerialInterface.py @@ -190,7 +190,7 @@ class SerialInterface(Interface): self.owner.inbound(data, self) threading.Thread(target=af, daemon=True).start() - def processOutgoing(self,data): + def process_outgoing(self,data): if self.online: data = bytes([HDLC.FLAG])+HDLC.escape(data)+bytes([HDLC.FLAG]) written = self.serial.write(data) diff --git a/RNS/Interfaces/AutoInterface.py b/RNS/Interfaces/AutoInterface.py index 5b922a2..dc8b208 100644 --- a/RNS/Interfaces/AutoInterface.py +++ b/RNS/Interfaces/AutoInterface.py @@ -470,7 +470,7 @@ class AutoInterface(Interface): self.rxb += len(data) self.owner.inbound(data, self) - def processOutgoing(self,data): + def process_outgoing(self,data): for peer in self.peers: try: if self.outbound_udp_socket == None: diff --git a/RNS/Interfaces/I2PInterface.py b/RNS/Interfaces/I2PInterface.py index 1ca0279..7fcb885 100644 --- a/RNS/Interfaces/I2PInterface.py +++ b/RNS/Interfaces/I2PInterface.py @@ -634,7 +634,7 @@ class I2PInterfacePeer(Interface): self.owner.inbound(data, self) - def processOutgoing(self, data): + def process_outgoing(self, data): if self.online: while self.writing: time.sleep(0.001) @@ -975,7 +975,7 @@ class I2PInterface(Interface): self.spawned_interfaces.append(spawned_interface) spawned_interface.read_loop() - def processOutgoing(self, data): + def process_outgoing(self, data): pass def received_announce(self, from_spawned=False): diff --git a/RNS/Interfaces/Interface.py b/RNS/Interfaces/Interface.py index 26e35f6..40eef7d 100755 --- a/RNS/Interfaces/Interface.py +++ b/RNS/Interfaces/Interface.py @@ -223,7 +223,7 @@ class Interface: wait_time = (tx_time / self.announce_cap) self.announce_allowed_at = now + wait_time - self.processOutgoing(selected["raw"]) + self.process_outgoing(selected["raw"]) self.sent_announce() if selected in self.announce_queue: diff --git a/RNS/Interfaces/KISSInterface.py b/RNS/Interfaces/KISSInterface.py index ecbeaa3..380f7ef 100644 --- a/RNS/Interfaces/KISSInterface.py +++ b/RNS/Interfaces/KISSInterface.py @@ -241,7 +241,7 @@ class KISSInterface(Interface): self.owner.inbound(data, self) - def processOutgoing(self,data): + def process_outgoing(self,data): datalen = len(data) if self.online: if self.interface_ready: @@ -275,7 +275,7 @@ class KISSInterface(Interface): if len(self.packet_queue) > 0: data = self.packet_queue.pop(0) self.interface_ready = True - self.processOutgoing(data) + self.process_outgoing(data) elif len(self.packet_queue) == 0: self.interface_ready = True @@ -344,7 +344,7 @@ class KISSInterface(Interface): while len(frame) < 15: frame.append(0x00) - self.processOutgoing(bytes(frame)) + self.process_outgoing(bytes(frame)) except Exception as e: self.online = False diff --git a/RNS/Interfaces/LocalInterface.py b/RNS/Interfaces/LocalInterface.py index c256b2c..cc15918 100644 --- a/RNS/Interfaces/LocalInterface.py +++ b/RNS/Interfaces/LocalInterface.py @@ -166,7 +166,7 @@ class LocalClientInterface(Interface): # duration = time.time() - processing_start # self.rxptime += duration - def processOutgoing(self, data): + def process_outgoing(self, data): if self.online: try: self.writing = True @@ -350,7 +350,7 @@ class LocalServerInterface(Interface): self.clients += 1 spawned_interface.read_loop() - def processOutgoing(self, data): + def process_outgoing(self, data): pass def received_announce(self, from_spawned=False): diff --git a/RNS/Interfaces/PipeInterface.py b/RNS/Interfaces/PipeInterface.py index 056f870..cb648d9 100644 --- a/RNS/Interfaces/PipeInterface.py +++ b/RNS/Interfaces/PipeInterface.py @@ -115,7 +115,7 @@ class PipeInterface(Interface): self.owner.inbound(data, self) - def processOutgoing(self,data): + def process_outgoing(self,data): if self.online: data = bytes([HDLC.FLAG])+HDLC.escape(data)+bytes([HDLC.FLAG]) written = self.process.stdin.write(data) diff --git a/RNS/Interfaces/RNodeInterface.py b/RNS/Interfaces/RNodeInterface.py index 512e72f..07e7d05 100644 --- a/RNS/Interfaces/RNodeInterface.py +++ b/RNS/Interfaces/RNodeInterface.py @@ -604,7 +604,7 @@ class RNodeInterface(Interface): self.r_stat_snr = None - def processOutgoing(self,data): + def process_outgoing(self,data): datalen = len(data) if self.online: if self.interface_ready: @@ -635,7 +635,7 @@ class RNodeInterface(Interface): if len(self.packet_queue) > 0: data = self.packet_queue.pop(0) self.interface_ready = True - self.processOutgoing(data) + self.process_outgoing(data) elif len(self.packet_queue) == 0: self.interface_ready = True @@ -935,7 +935,7 @@ class RNodeInterface(Interface): if self.first_tx != None: if time.time() > self.first_tx + self.id_interval: RNS.log("Interface "+str(self)+" is transmitting beacon data: "+str(self.id_callsign.decode("utf-8")), RNS.LOG_DEBUG) - self.processOutgoing(self.id_callsign) + self.process_outgoing(self.id_callsign) sleep(0.08) diff --git a/RNS/Interfaces/RNodeMultiInterface.py b/RNS/Interfaces/RNodeMultiInterface.py index d60ad4e..85b110c 100644 --- a/RNS/Interfaces/RNodeMultiInterface.py +++ b/RNS/Interfaces/RNodeMultiInterface.py @@ -566,7 +566,7 @@ class RNodeMultiInterface(Interface): RNS.log("Please update your RNode firmware with rnodeconf from https://github.com/markqvist/Reticulum/RNS/Utilities/rnodeconf.py") RNS.panic() - def processOutgoing(self, data, interface = None): + def process_outgoing(self, data, interface = None): if interface is None: # do nothing if RNS tries to transmit on this interface directly pass @@ -893,7 +893,7 @@ class RNodeMultiInterface(Interface): for interface in self.subinterfaces: if interface != 0 and interface.online: interface_available = True - self.subinterfaces[interface.index].processOutgoing(self.id_callsign) + self.subinterfaces[interface.index].process_outgoing(self.id_callsign) if interface_available: RNS.log("Interface "+str(self)+" is transmitting beacon data on all subinterfaces: "+str(self.id_callsign.decode("utf-8")), RNS.LOG_DEBUG) @@ -1205,7 +1205,7 @@ class RNodeSubInterface(Interface): self.r_stat_rssi = None self.r_stat_snr = None - def processOutgoing(self,data): + def process_outgoing(self,data): if self.online: if self.interface_ready: if self.flow_control: @@ -1217,7 +1217,7 @@ class RNodeSubInterface(Interface): if self.parent_interface.first_tx == None: self.parent_interface.first_tx = time.time() self.txb += len(data) - self.parent_interface.processOutgoing(data, self) + self.parent_interface.process_outgoing(data, self) else: self.queue(data) @@ -1229,7 +1229,7 @@ class RNodeSubInterface(Interface): if len(self.packet_queue) > 0: data = self.packet_queue.pop(0) self.interface_ready = True - self.processOutgoing(data) + self.process_outgoing(data) elif len(self.packet_queue) == 0: self.interface_ready = True diff --git a/RNS/Interfaces/SerialInterface.py b/RNS/Interfaces/SerialInterface.py index c9e20c0..2a8542b 100755 --- a/RNS/Interfaces/SerialInterface.py +++ b/RNS/Interfaces/SerialInterface.py @@ -138,7 +138,7 @@ class SerialInterface(Interface): self.owner.inbound(data, self) - def processOutgoing(self,data): + def process_outgoing(self,data): if self.online: data = bytes([HDLC.FLAG])+HDLC.escape(data)+bytes([HDLC.FLAG]) written = self.serial.write(data) diff --git a/RNS/Interfaces/TCPInterface.py b/RNS/Interfaces/TCPInterface.py index 9516036..991bfb6 100644 --- a/RNS/Interfaces/TCPInterface.py +++ b/RNS/Interfaces/TCPInterface.py @@ -291,7 +291,7 @@ class TCPClientInterface(Interface): self.owner.inbound(data, self) - def processOutgoing(self, data): + def process_outgoing(self, data): if self.online: # while self.writing: # time.sleep(0.01) @@ -593,7 +593,7 @@ class TCPServerInterface(Interface): def sent_announce(self, from_spawned=False): if from_spawned: self.oa_freq_deque.append(time.time()) - def processOutgoing(self, data): + def process_outgoing(self, data): pass diff --git a/RNS/Interfaces/UDPInterface.py b/RNS/Interfaces/UDPInterface.py index 6dcba4a..cb7d3a5 100644 --- a/RNS/Interfaces/UDPInterface.py +++ b/RNS/Interfaces/UDPInterface.py @@ -109,7 +109,7 @@ class UDPInterface(Interface): self.rxb += len(data) self.owner.inbound(data, self) - def processOutgoing(self,data): + def process_outgoing(self,data): try: udp_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) udp_socket.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) diff --git a/RNS/Transport.py b/RNS/Transport.py index 2338383..bae70f3 100755 --- a/RNS/Transport.py +++ b/RNS/Transport.py @@ -743,10 +743,10 @@ class Transport: i += 1 # Send it - interface.processOutgoing(masked_raw) + interface.process_outgoing(masked_raw) else: - interface.processOutgoing(raw) + interface.process_outgoing(raw) except Exception as e: RNS.log("Error while transmitting on "+str(interface)+". The contained exception was: "+str(e), RNS.LOG_ERROR)