feat(sim): GPS/Sensors home pages + repeater instant self-advert

- Turn on ENV_INCLUDE_GPS/UI_SENSORS_PAGE for the sim build (both were
  compiled out entirely, so the GPS and Sensors home-page carousel
  entries didn't exist regardless of home_pages_mask) -- SimSensorManager
  already fed a real JS-settable GPS fix and a temperature/battery
  channel with nothing to display them.
- Add sim_test_advert_flood() to the repeater build too, mirroring
  companion_radio's hook: MyMesh::updateAdvertTimer() otherwise leaves
  the repeater's first self-advert 2 minutes out, so a host page
  couldn't make it discoverable as a contact (needed for admin login)
  right away.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018iubftDmKNWmkNnhJRz8UH
This commit is contained in:
Jakub
2026-09-03 23:19:36 +02:00
co-authored by Claude Sonnet 5
parent f8ab4c3a98
commit 80c375427a
3 changed files with 33 additions and 0 deletions
+16
View File
@@ -48,6 +48,22 @@ static bool g_sim_ready = false;
extern "C" EMSCRIPTEN_KEEPALIVE int sim_is_ready() {
return g_sim_ready ? 1 : 0;
}
// Same idea as companion_radio's sim_test_advert_flood() -- MyMesh's own
// updateAdvertTimer() (called once from begin()) doesn't fire the repeater's
// first self-advert for a full 2 minutes (advert_interval defaults to 1,
// scaled *2*60*1000ms -- see MyMesh::updateAdvertTimer()/begin() in this
// same MyMesh.cpp), so a host page that wants hero/B to discover the
// repeater as a contact immediately on boot (rather than waiting out that
// timer) needs some way to trigger it early. sendSelfAdvertisement(0, true)
// is the exact same call updateAdvertTimer()'s scheduled path eventually
// makes, just invoked now instead of on a timer -- real crypto, real
// packet, nothing faked.
extern "C" EMSCRIPTEN_KEEPALIVE int sim_test_advert_flood() {
if (!g_sim_ready) return 0;
the_mesh.sendSelfAdvertisement(0, true);
return 1;
}
#endif
static char command[160];