feat: add periodic auto-advert with GPS position (Auto-Advert tool)

Adds configurable periodic 0-hop self-advert that includes GPS coordinates,
making the device's position visible in other nodes' Nearby Nodes screen.
Options: off / 1min / 2min / 5min / 10min / 30min / 1h.

Accessible via Tools → Auto-Advert. Timer runs in MyMesh::loop().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-05-14 16:08:33 +02:00
parent d59687647f
commit 09ac455806
8 changed files with 95 additions and 5 deletions

View File

@@ -854,6 +854,7 @@ MyMesh::MyMesh(mesh::Radio &radio, mesh::RNG &rng, mesh::RTCClock &rtc, SimpleMe
offline_queue_len = 0;
app_target_ver = 0;
_bot_last_reply_ms = 0;
_next_auto_advert_ms = 0;
clearPendingReqs();
next_ack_idx = 0;
sign_data = NULL;
@@ -2204,6 +2205,11 @@ void MyMesh::loop() {
dirty_contacts_expiry = 0;
}
if (_prefs.advert_auto_interval_sec > 0 && millisHasNowPassed(_next_auto_advert_ms)) {
advert();
_next_auto_advert_ms = futureMillis(_prefs.advert_auto_interval_sec * 1000UL);
}
#ifdef DISPLAY_CLASS
if (_ui) _ui->setHasConnection(_serial->isConnected());
#endif