Files
MeshCore-Solo/variants/sim/target.h
T
Jakub 8f4c92a217 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.
2026-09-03 00:46:47 +02:00

30 lines
807 B
C

#pragma once
// variants/sim -- native (host) "board" for running the real companion_radio
// app logic (MyMesh/UITask/DataStore) as a plain terminal program, with no
// real radio/display/BLE hardware. Follows the same target.h/target.cpp/
// platformio.ini triplet convention as every other board variant (see
// variants/generic-e22/ for the template this was modelled on).
#include <Mesh.h>
#include "SimRadio.h"
#include "SimMainBoard.h"
#include "SimRTCClock.h"
#include <helpers/SensorManager.h>
#ifdef DISPLAY_CLASS
#include "SimDisplayDriver.h"
#endif
extern SimMainBoard board;
extern SimRadio radio_driver;
extern SimRTCClock rtc_clock;
extern SensorManager sensors;
#ifdef DISPLAY_CLASS
extern DISPLAY_CLASS display;
#endif
bool radio_init();
mesh::LocalIdentity radio_new_identity();