mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Merge branch 'dev' into rep-room-acl
# Conflicts: # examples/simple_repeater/main.cpp
This commit is contained in:
commit
08f91f8d95
35 changed files with 1970 additions and 15 deletions
|
|
@ -207,6 +207,9 @@ void MyMesh::logRx(mesh::Packet *pkt, int len, float score) {
|
|||
}
|
||||
|
||||
void MyMesh::logTx(mesh::Packet *pkt, int len) {
|
||||
#ifdef WITH_BRIDGE
|
||||
bridge->onPacketTransmitted(pkt);
|
||||
#endif
|
||||
if (_logging) {
|
||||
File f = openAppend(PACKET_LOG_FILE);
|
||||
if (f) {
|
||||
|
|
@ -471,6 +474,15 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc
|
|||
mesh::RTCClock &rtc, mesh::MeshTables &tables)
|
||||
: mesh::Mesh(radio, ms, rng, rtc, *new StaticPoolPacketManager(32), tables),
|
||||
_cli(board, rtc, &_prefs, this), telemetry(MAX_PACKET_PAYLOAD - 4) {
|
||||
#ifdef WITH_BRIDGE
|
||||
#if defined(WITH_RS232_BRIDGE)
|
||||
bridge = new RS232Bridge(WITH_RS232_BRIDGE, _mgr, &rtc);
|
||||
#elif defined(WITH_ESPNOW_BRIDGE)
|
||||
bridge = new ESPNowBridge(_mgr, &rtc);
|
||||
#else
|
||||
#error "You must choose either RS232 or ESPNow bridge"
|
||||
#endif
|
||||
#endif
|
||||
memset(known_clients, 0, sizeof(known_clients));
|
||||
next_local_advert = next_flood_advert = 0;
|
||||
set_radio_at = revert_radio_at = 0;
|
||||
|
|
@ -655,6 +667,10 @@ void MyMesh::handleCommand(uint32_t sender_timestamp, char *command, char *reply
|
|||
}
|
||||
|
||||
void MyMesh::loop() {
|
||||
#ifdef WITH_BRIDGE
|
||||
bridge->loop();
|
||||
#endif
|
||||
|
||||
mesh::Mesh::loop();
|
||||
|
||||
if (next_flood_advert && millisHasNowPassed(next_flood_advert)) {
|
||||
|
|
|
|||
|
|
@ -21,6 +21,20 @@
|
|||
#include <RTClib.h>
|
||||
#include <target.h>
|
||||
|
||||
#ifdef WITH_RS232_BRIDGE
|
||||
#include "helpers/bridges/RS232Bridge.h"
|
||||
#define WITH_BRIDGE
|
||||
#endif
|
||||
|
||||
#ifdef WITH_ESPNOW_BRIDGE
|
||||
#include "helpers/bridges/ESPNowBridge.h"
|
||||
#define WITH_BRIDGE
|
||||
#endif
|
||||
|
||||
#ifdef WITH_BRIDGE
|
||||
extern AbstractBridge* bridge;
|
||||
#endif
|
||||
|
||||
struct RepeaterStats {
|
||||
uint16_t batt_milli_volts;
|
||||
uint16_t curr_tx_queue_len;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@
|
|||
static UITask ui_task(display);
|
||||
#endif
|
||||
|
||||
#ifdef WITH_BRIDGE
|
||||
AbstractBridge* bridge;
|
||||
#endif
|
||||
|
||||
StdRNG fast_rng;
|
||||
SimpleMeshTables tables;
|
||||
|
||||
|
|
@ -23,6 +27,10 @@ void setup() {
|
|||
Serial.begin(115200);
|
||||
delay(1000);
|
||||
|
||||
#ifdef WITH_BRIDGE
|
||||
bridge->begin();
|
||||
#endif
|
||||
|
||||
board.begin();
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
|
|
@ -34,7 +42,9 @@ void setup() {
|
|||
}
|
||||
#endif
|
||||
|
||||
if (!radio_init()) { halt(); }
|
||||
if (!radio_init()) {
|
||||
halt();
|
||||
}
|
||||
|
||||
fast_rng.begin(radio_get_rng_seed());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue