Files
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

54 lines
1.2 KiB
C++

/*
* CayenneLPP - CayenneLPP Message Struct
*
* Copyright (C) 2021 by Manuel Weichselbaumer <mincequi@web.de>
*
* Use of this source code is governed by the MIT license that can be found in the LICENSE file.
*
*/
#ifndef CAYENNE_LPP_MESSAGE_H
#define CAYENNE_LPP_MESSAGE_H
#include <array>
#include <cstdint>
#include <vector>
struct CayenneLPPMessage {
// Original LPPv1 data types
uint32_t digitalInput = 0;
uint32_t digitalOutput = 0;
float analogInput = 0.0f;
float analogOutput = 0.0f;
uint32_t luminosity = 0;
uint32_t presence = 0;
float temperature = 0.0f;
float relativeHumidity = 0.0f;
std::array<float, 3> accelerometer;
float barometricPressure = 0.0f;
std::array<float, 3> gyrometer;
std::array<float, 3> gps;
// Additional data types
uint32_t unixTime = 0;
float genericSensor = 0.0f;
float voltage = 0.0f;
float current = 0.0f;
uint32_t frequency = 0;
uint32_t percentage = 0;
float altitude = 0.0f;
float power = 0.0f;
float distance = 0.0f;
float energy = 0.0f;
float direction = 0.0f;
uint32_t onOffSwitch = 0;
uint32_t concentration = 0;
std::array<uint8_t, 3> colour;
// Non-IPSO data types
std::vector<std::pair<double, double>> polyline;
};
#endif