feat(sim): add variants/sim/ — real companion_radio firmware on native + Emscripten

New board variant compiling the unmodified MyMesh/UITask/DataStore app
logic against real mesh::Radio/MainBoard/RTCClock/RNG interfaces, for
running the actual firmware outside embedded hardware:

- Native (plain g++, platform = native): ASCII-art display over stdout,
  stdin-driven input, local-disk-backed DataStore/IdentityStore.
- Emscripten/WASM (variants/sim/build_wasm.sh, since PlatformIO's native
  platform force-overrides any CC/CXX toolchain override back to system
  clang++): canvas-backed display, IDBFS-backed persistence across page
  reloads, JS-callable input via sim_enqueue_key(), emscripten_set_main_loop.

Real rweather/Crypto (AES128/SHA256/Ed25519) vendored unmodified and
proven working on both targets. variants/sim/web/index.html is a bare
verification harness, not the polished website embed.
This commit is contained in:
Jakub
2026-09-03 00:46:47 +02:00
parent bbf107d62c
commit 8f4c92a217
197 changed files with 23070 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
#pragma once
#include <helpers/BaseSerialInterface.h>
// BaseSerialInterface stub for the native sim build: no companion app can
// connect over BLE/USB in Phase 1 (there's no real transport), so this
// always reports "not connected, nothing to do". Enough to let MyMesh's
// startInterface()/loop() run unmodified.
class SimSerialInterface : public BaseSerialInterface {
public:
void begin() { }
void enable() override { }
void disable() override { }
bool isEnabled() const override { return false; }
bool isConnected() const override { return false; }
bool isWriteBusy() const override { return false; }
size_t writeFrame(const uint8_t src[], size_t len) override { return 0; }
size_t checkRecvFrame(uint8_t dest[]) override { return 0; }
};