Added physical layer link stats to link and packet classes

This commit is contained in:
Mark Qvist 2023-10-24 01:41:12 +02:00
parent cf125daf5c
commit bed71fa3f8
3 changed files with 37 additions and 0 deletions

View file

@ -116,6 +116,7 @@ class Transport:
local_client_rssi_cache = []
local_client_snr_cache = []
local_client_q_cache = []
LOCAL_CLIENT_CACHE_MAXSIZE = 512
pending_local_path_requests = {}
@ -1096,6 +1097,15 @@ class Transport:
while len(Transport.local_client_snr_cache) > Transport.LOCAL_CLIENT_CACHE_MAXSIZE:
Transport.local_client_snr_cache.pop(0)
if hasattr(interface, "r_stat_q"):
if interface.r_stat_q != None:
packet.q = interface.r_stat_q
if len(Transport.local_client_interfaces) > 0:
Transport.local_client_q_cache.append([packet.packet_hash, packet.q])
while len(Transport.local_client_q_cache) > Transport.LOCAL_CLIENT_CACHE_MAXSIZE:
Transport.local_client_q_cache.pop(0)
if len(Transport.local_client_interfaces) > 0:
if Transport.is_local_client_interface(interface):
packet.hops -= 1