touch: beta_22 (test) — trace-ping signal probe + companion contact-refresh (#73)

Signal probe: replace the beta_21 zero-hop advert (which nothing replies to, so the
signal never updated) with a directed TRACE ping to the nearest reachable repeater.
It retransmits — a real reply we measure — without flooding the mesh. New
MyMesh::uiSendSignalProbe() picks the shortest-path repeater; the reply is captured
silently in onTraceRecv via _ui_sig_probe_tag. Falls back to a zero-hop advert when
no repeater is known. Thanks to Tarmo for the insight.

Contacts (#73 part A): a contact discovered while a companion app is connected over
BLE now refreshes the device's own Contacts list + notification. onDiscoveredContact
fired the UI notify only in the standalone branch — move it out so it always fires,
and flag the list dirty for UITask::loop to rebuild on the LVGL thread.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kaj SchittecatandClaude Opus 4.8 committed 2026-07-01 08:46:56 +02:00
1 parent b5e428734c
commit 0731b5ff67
5 files changed
+92 -6

No files matched your search

+18 -4
View File
@@ -1745,12 +1745,14 @@ void MyMesh::onDiscoveredContact(ContactInfo &contact, bool is_new, uint8_t path
memcpy(&out_frame[1], contact.id.pub_key, PUB_KEY_SIZE);
_serial->writeFrameToAll(out_frame, 1 + PUB_KEY_SIZE);
}
} else {
#ifdef DISPLAY_CLASS
if (_ui) _ui->notify(UIEventType::newContactMessage);
#endif
}
#ifdef DISPLAY_CLASS
// Notify the touch UI whether or not a companion app is connected. This used to
// fire only in the standalone (else) branch, so a contact discovered while the
// phone app was attached over BLE gave the device's OWN screen no indication and
// never refreshed its Contacts list (issue #73). notify() flags the list dirty so
// UITask::loop rebuilds it when the Contacts tab is showing.
if (_ui) _ui->notify(UIEventType::newContactMessage);
// Mirror to the touch UI's Discovered store so the user can browse pending
// adverts and manually add nodes to contacts[] (used when auto-add is off
// or contacts[] is full). `is_new=true` here means the contact is NOT yet
@@ -2362,6 +2364,18 @@ void MyMesh::onRawDataRecv(mesh::Packet *packet) {
void MyMesh::onTraceRecv(mesh::Packet *packet, uint32_t tag, uint32_t auth_code, uint8_t flags,
const uint8_t *path_snrs, const uint8_t *path_hashes, uint8_t path_len) {
uint8_t path_sz = flags & 0x03; // NEW v1.11+
// Silent SIGNAL PROBE result: a directed trace we sent to a neighbouring repeater
// has come back (it retransmitted; we heard it). Capture OUR reception of that
// reply — SNR + RSSI — as the live signal, and swallow it (no popup). This is the
// non-flooding replacement for the old flood-advert probe, and must run before the
// visible-ping path below.
if (tag != 0 && tag == _ui_sig_probe_tag) {
_ui_sig_probe_tag = 0;
_ui_sig_snr_q4 = (int8_t)(packet->getSNR() * 4.0f);
_ui_sig_rssi = (int8_t)_radio->getLastRSSI();
_ui_sig_ms = millis();
return;
}
#if defined(DISPLAY_CLASS)
// If this trace's tag matches the most recent UI-initiated ping, surface
// the bidirectional SNRs directly to the touch UI instead of (or in