mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-05 19:56:11 +00:00
feat: show RSSI in discover results list
Add rssi field to DiscoverResult, captured from _radio->getLastRSSI() when the discover response is received. Display format in the right column: known node → "Rpt-87" / "Snsr-92" (type + dBm) new node → "*-87" (asterisk + dBm; type already visible in "[Rpt]" label) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
6249e63ec0
commit
2a9874d05d
@@ -212,12 +212,15 @@ class NearbyScreen : public UIScreen {
|
||||
display.translateUTF8ToBlocks(filtered, label, sizeof(filtered));
|
||||
display.drawTextEllipsized(2, y, DIST_COL - 4, filtered);
|
||||
|
||||
// right: short type name; prefix '*' for nodes not in contacts
|
||||
// right: type+RSSI for known ("Rpt-87"), just RSSI with '*' for new ("*-87")
|
||||
const char* st = (r.type == ADV_TYPE_REPEATER) ? "Rpt" :
|
||||
(r.type == ADV_TYPE_SENSOR) ? "Snsr" :
|
||||
(r.type == ADV_TYPE_ROOM) ? "Room" : "?";
|
||||
char rtype[8];
|
||||
snprintf(rtype, sizeof(rtype), r.is_known ? "%s" : "*%s", st);
|
||||
char rtype[12];
|
||||
if (r.is_known)
|
||||
snprintf(rtype, sizeof(rtype), "%s%d", st, (int)r.rssi);
|
||||
else
|
||||
snprintf(rtype, sizeof(rtype), "*%d", (int)r.rssi);
|
||||
display.setCursor(DIST_COL, y);
|
||||
display.print(rtype);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user