core: restore upstream shape for the shared mesh core

- Mesh, Dispatcher, Packet, packet pool and the core headers rebuilt from
  Arduino MeshCore's text; ZephCore changes re-applied, each fenced
  `// ZEPHCORE:` (diff vs upstream: 4540 -> 1147 lines)
- upstream header layout; MainBoard gains handleCommand/loop and the other
  upstream members; RNG::nextInt back in Utils.cpp
- packet logging moved to the roles' log hooks (helpers/PacketLog.h)
- zero-hop direct ACKs deduplicated and length-checked as upstream
- RadioIncludes.h -> src/, LoRaConfig.h -> helpers/
- .editorconfig: shared files keep upstream formatting

Verified: 10 role builds, per-function disassembly review, bench DM/ACK
regression (T1000-E, Wio L1, XIAO S3 on 1.17.4) incl. via live repeater.
This commit is contained in:
liquidraver
2026-09-23 13:39:48 +02:00
parent 2e2d852f29
commit a7d073900e
44 changed files with 2551 additions and 2488 deletions
+9 -2
View File
@@ -7,7 +7,7 @@
#include "observer_creds.h"
#include <mesh/Utils.h>
#include <mesh/LoRaConfig.h>
#include <helpers/LoRaConfig.h>
#include <adapters/radio/LoRaRadioBase.h>
#include <adapters/rng/ZephyrRNG.h> /* generateFirstBootIdentity (hardened keygen) */
#include <helpers/MeshcoreJson.h>
@@ -22,6 +22,7 @@ LOG_MODULE_REGISTER(zephcore_observer, CONFIG_ZEPHCORE_OBSERVER_LOG_LEVEL);
#include <time.h>
#include <ZephyrMQTTPublisher.h>
#include <helpers/PacketLog.h>
/* Forward declaration — implemented in ZephyrWiFiStation.c */
extern "C" {
@@ -193,10 +194,16 @@ void ObserverMesh::logRxRaw(float snr, float rssi, const uint8_t raw[], int len)
void ObserverMesh::logRx(Packet *packet, int len, float score)
{
(void)packet; (void)len;
packet_log_rx(getLogDateTime(), packet, _radio->getLastRSSI(), score, _radio->getEstAirtimeFor(len));
_last_score = score;
}
void ObserverMesh::logTx(Packet *packet, int len)
{
(void)len;
packet_log_tx(getLogDateTime(), packet);
}
void ObserverMesh::enqueuePacket(Packet *pkt)
{
/* Compute packet hash (8 bytes → 16 hex chars) */