mirror of
https://github.com/markqvist/Reticulum.git
synced 2026-01-07 19:45:43 -05:00
Cleanup
This commit is contained in:
parent
f400fd7b60
commit
48fe97291b
3 changed files with 13 additions and 13 deletions
|
|
@ -24,7 +24,7 @@ APP_NAME = "rnstransport"
|
|||
|
||||
class InterfaceAnnouncer():
|
||||
JOB_INTERVAL = 60
|
||||
DEFAULT_STAMP_VALUE = 20
|
||||
DEFAULT_STAMP_VALUE = 14
|
||||
WORKBLOCK_EXPAND_ROUNDS = 20
|
||||
|
||||
DISCOVERABLE_INTERFACE_TYPES = ["BackboneInterface", "TCPServerInterface", "TCPClientInterface", "RNodeInterface", "I2PInterface", "KISSInterface"]
|
||||
|
|
@ -125,7 +125,7 @@ class InterfaceAnnouncer():
|
|||
if not stamp: return None
|
||||
else:
|
||||
self.stamp_cache[infohash] = stamp
|
||||
return packed+stamp
|
||||
return bytes([0x00])+packed+stamp
|
||||
|
||||
class InterfaceAnnounceHandler:
|
||||
def __init__(self, required_value=InterfaceAnnouncer.DEFAULT_STAMP_VALUE, callback=None):
|
||||
|
|
@ -143,7 +143,8 @@ class InterfaceAnnounceHandler:
|
|||
|
||||
def received_announce(self, destination_hash, announced_identity, app_data):
|
||||
try:
|
||||
if app_data and len(app_data) > self.stamper.STAMP_SIZE:
|
||||
if app_data and len(app_data) > self.stamper.STAMP_SIZE+1:
|
||||
app_data = app_data[1:]
|
||||
stamp = app_data[-self.stamper.STAMP_SIZE:]
|
||||
packed = app_data[:-self.stamper.STAMP_SIZE]
|
||||
infohash = RNS.Identity.full_hash(packed)
|
||||
|
|
@ -308,8 +309,7 @@ class InterfaceDiscovery():
|
|||
hops = info["hops"]; ms = "" if hops == 1 else "s"
|
||||
filename = RNS.hexrep(discovery_hash, delimit=False)
|
||||
filepath = os.path.join(self.storagepath, filename)
|
||||
RNS.log(f"Discovered interface {RNS.prettyhexrep(discovery_hash)} {hops} hop{ms} away: {name}")
|
||||
print(info["config_entry"])
|
||||
RNS.log(f"Discovered interface {RNS.prettyhexrep(discovery_hash)} {hops} hop{ms} away: {name}", RNS.LOG_DEBUG)
|
||||
if not os.path.isfile(filepath):
|
||||
try:
|
||||
with open(filepath, "wb") as f:
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ instance_name = default
|
|||
# can configure the minimum required value to accept as
|
||||
# valid for discovered interfaces.
|
||||
|
||||
# required_discovery_value = 20
|
||||
# required_discovery_value = 14
|
||||
|
||||
|
||||
# You can configure Reticulum to panic and forcibly close
|
||||
|
|
|
|||
|
|
@ -225,14 +225,14 @@ def program_setup(configdir, dispall=False, verbosity=0, name_filter=None, json=
|
|||
print(f"Last Heard : {last_heard_display}")
|
||||
print(f"Location : {location}")
|
||||
|
||||
if "frequency" in i: print(f"Frequency : {i["frequency"]:,} Hz")
|
||||
if "bandwidth" in i: print(f"Bandwidth : {i["bandwidth"]:,} Hz")
|
||||
if "sf" in i: print(f"Sprd.Factor : {i["sf"]}")
|
||||
if "cr" in i: print(f"Coding Rate : {i["cr"]}")
|
||||
if "modulation" in i: print(f"Modulation : {i["modulation"]}")
|
||||
if "reachable_on" in i: print(f"Address : {i["reachable_on"]}:{i["port"]}")
|
||||
if "frequency" in i: print(f"Frequency : {i['frequency']:,} Hz")
|
||||
if "bandwidth" in i: print(f"Bandwidth : {i['bandwidth']:,} Hz")
|
||||
if "sf" in i: print(f"Sprd.Factor : {i['sf']}")
|
||||
if "cr" in i: print(f"Coding Rate : {i['cr']}")
|
||||
if "modulation" in i: print(f"Modulation : {i['modulation']}")
|
||||
if "reachable_on" in i: print(f"Address : {i['reachable_on']}:{i['port']}")
|
||||
|
||||
print(f"Stamp Value : {i["value"]}")
|
||||
print(f"Stamp Value : {i['value']}")
|
||||
|
||||
print(f"\nConfiguration Entry:")
|
||||
config_lines = i["config_entry"].split('\n')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue