feat(sim): host-page buzzer mute hook + randomized repeater names

sim_buzzer_toggle_quiet()/sim_buzzer_get_quiet() (UITask.cpp) call the
literal UITask::toggleBuzzer() the real on-device Settings > Buzzer mute
toggle already calls -- persists into NodePrefs.buzzer_quiet, clears
buzzer_auto, saves prefs, shows the real "Buzzer: ON/OFF" alert. Not a
re-implementation, not a host-side Web Audio mute layered on top.

Every simple_repeater instance advertised the literal ADVERT_NAME
("repeater") -- across meshcore-solo-site's cross-visitor relay bridge
every hop in every path/relay list was an indistinguishable wall of
"repeater"s. A SIM_PLATFORM/__EMSCRIPTEN__-only default now picks a
random "<adjective> <geographic feature>" pair from
sim_instance_entropy() (real crypto.getRandomValues()-sourced entropy,
already used for RNG seeding) at first boot -- matches the real,
common ham-radio convention of naming a repeater after the hill it
sits on. Persists normally across reboots via the existing prefs
load/save path, same as a real operator-set name would.

sim_repeater_get_name() added alongside the existing
sim_repeater_get_relay_count() for host-page/test access to the
result.

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-05 08:36:02 +02:00
co-authored by Claude Sonnet 5
parent a54922e3d6
commit a18a821326
3 changed files with 48 additions and 0 deletions
+12
View File
@@ -41,6 +41,18 @@ extern "C" EMSCRIPTEN_KEEPALIVE uint32_t sim_repeater_get_relay_count() {
return the_mesh.getNumForwarded();
}
// This instance's own advertised name (NodePrefs.node_name via
// MyMesh::getNodeName()) -- randomized per-visitor at first boot (see the
// SIM_PLATFORM/__EMSCRIPTEN__ branch in MyMesh's constructor) so every
// hop in a cross-visitor path/relay list isn't just an indistinguishable
// wall of the literal "repeater". Returns a pointer straight into
// NodePrefs's own fixed buffer -- valid for the process's whole lifetime,
// same as every other read-only getter here, no ownership handoff needed
// (ccall(..., 'string', ...) on the JS side copies it out immediately).
extern "C" EMSCRIPTEN_KEEPALIVE const char* sim_repeater_get_name() {
return the_mesh.getNodeName();
}
// Same "has setup() actually finished" readiness flag as
// examples/companion_radio/main.cpp -- see that file's comment for why
// this is needed instead of a fixed post-ready delay.