mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-08-08 14:32:47 -04:00
Added physical layer link stats to link and packet classes
This commit is contained in:
parent
cf125daf5c
commit
bed71fa3f8
3 changed files with 37 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue