Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
markqvist committed Dec 11, 2024
1 parent 15600d5 commit 19cae41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions sbapp/sideband/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ def received_announce(self, destination_hash, announced_identity, app_data, anno
# age = 0
pass

link_stats = {"rssi": self.reticulum.get_packet_rssi(announce_packet_hash),
"snr": self.reticulum.get_packet_snr(announce_packet_hash),
"q": self.reticulum.get_packet_q(announce_packet_hash)}
link_stats = {"rssi": self.owner_app.sideband.reticulum.get_packet_rssi(announce_packet_hash),
"snr": self.owner_app.sideband.reticulum.get_packet_snr(announce_packet_hash),
"q": self.owner_app.sideband.reticulum.get_packet_q(announce_packet_hash)}

RNS.log("Detected active propagation node "+RNS.prettyhexrep(destination_hash)+" emission "+str(age)+" seconds ago, "+str(hops)+" hops away")
self.owner.log_announce(destination_hash, app_data, dest_type=PropagationNodeDetector.aspect_filter, link_stats=link_stats)
Expand Down
6 changes: 3 additions & 3 deletions sbapp/ui/announces.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ def update_widget(self):
link_extras_full = ""
if "extras" in announce and announce["extras"] != None:
extras = announce["extras"]
RNS.log("Announce has extras: "+str(announce["extras"]))
if "link_stats" in extras:
link_stats = extras["link_stats"]
if "rssi" in link_stats and "snr" in link_stats and "q" in link_stats:
a_rssi = link_stats["rssi"]
a_snr = link_stats["snr"]
a_q = link_stats["q"]
link_extras_str = f" ([b]RSSI[/b] {a_rssi} [b]SNR[/b] {a_snr})"
link_extras_full = f"\n[b]Link Quality[/b] {a_q}%[/b]\n[b]RSSI[/b] {a_rssi}\n[b]SNR[/b] {a_snr}"
if a_rssi != None and a_snr != None and a_q != None:
link_extras_str = f" ([b]RSSI[/b] {a_rssi} [b]SNR[/b] {a_snr})"
link_extras_full = f"\n[b]Link Quality[/b] {a_q}%[/b]\n[b]RSSI[/b] {a_rssi}\n[b]SNR[/b] {a_snr}"

sig_icon = multilingual_markup(sig_icon_for_q(a_q).encode("utf-8")).decode("utf-8")

Expand Down

0 comments on commit 19cae41

Please sign in to comment.