mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-04-27 16:10:32 +00:00
parent
2e81527478
commit
3f393e5b8f
1 changed files with 0 additions and 20 deletions
20
meshchat.py
20
meshchat.py
|
|
@ -143,22 +143,6 @@ class ReticulumMeshChat:
|
|||
self.audio_call_manager = AudioCallManager(identity=self.identity)
|
||||
self.audio_call_manager.register_incoming_call_callback(self.on_incoming_audio_call)
|
||||
|
||||
# create a new implementation of RNS.Transport.packet_filter so we can intercept every incoming packet
|
||||
original_packet_filter = RNS.Transport.packet_filter
|
||||
def hooked_packet_filter(packet):
|
||||
|
||||
# fire callback
|
||||
try:
|
||||
self.on_rns_packet(packet)
|
||||
except:
|
||||
pass
|
||||
|
||||
# call original implementation
|
||||
return original_packet_filter(packet)
|
||||
|
||||
# hook original implementation
|
||||
RNS.Transport.packet_filter = staticmethod(hooked_packet_filter)
|
||||
|
||||
# start background thread for auto announce loop
|
||||
thread = threading.Thread(target=asyncio.run, args=(self.announce_loop(),))
|
||||
thread.daemon = True
|
||||
|
|
@ -239,10 +223,6 @@ class ReticulumMeshChat:
|
|||
# wait 1 second before next loop
|
||||
await asyncio.sleep(1)
|
||||
|
||||
# called for every received packet
|
||||
def on_rns_packet(self, packet: RNS.Packet):
|
||||
print(f"on_rns_packet: {packet.get_hash().hex()}: snr={packet.get_snr()}, rssi={packet.get_rssi()}, link_quality={packet.get_q()}")
|
||||
|
||||
# uses the provided destination hash as the active propagation node
|
||||
def set_active_propagation_node(self, destination_hash: str | None):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue