mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-11-04 12:07:42 +00:00
Add scheduled dual LoRa profiles
Support radio2, temporary profiles and one schedule slot per command family. Preserve reply affinity, shared airtime and session expiry with guarded warm switching on SX1262 and LR1110. Validate native routing, scheduling, persistence and driver failure paths; build Companion, repeater, room and sensor roles on ESP32, nRF52 and STM32.
This commit is contained in:
1 parent
428a95c643
commit
e896eec430
73 files changed
+4832
-273
No files matched your search
@@ -683,6 +683,7 @@ void SensorMesh::onPeerDataRecv(mesh::Packet* packet, uint8_t type, int sender_i
|
||||
temp[4] = (TXT_TYPE_CLI_DATA << 2);
|
||||
|
||||
auto reply = createDatagram(PAYLOAD_TYPE_TXT_MSG, from->id, secret, temp, 5 + text_len);
|
||||
_prefs.getRadioPrefs()->profileCLI().attachReply(reply);
|
||||
if (reply) {
|
||||
if (from->out_path_len == OUT_PATH_UNKNOWN) {
|
||||
sendFloodReply(reply, CLI_REPLY_DELAY_MILLIS, packet->getPathHashSize());
|
||||
@@ -856,6 +857,7 @@ void SensorMesh::begin(FILESYSTEM* fs) {
|
||||
}
|
||||
|
||||
radio_driver.setParams(_prefs.freq, _prefs.bw, _prefs.sf, _prefs.cr);
|
||||
_prefs.getRadioPrefs()->profileCLI().begin(*_prefs.getRadioPrefs(), radio_driver, *getRTCClock(), this);
|
||||
radio_driver.setTxPower(_prefs.tx_power_dbm);
|
||||
|
||||
board.attachDynamicPrefs(_prefs.getCustom());
|
||||
@@ -999,7 +1001,10 @@ bool SensorMesh::getGPS(uint8_t channel, float& lat, float& lon, float& alt) {
|
||||
}
|
||||
|
||||
void SensorMesh::loop() {
|
||||
auto& profiles = _prefs.getRadioPrefs()->profileCLI();
|
||||
profiles.loop(!hasPendingTransmissions());
|
||||
mesh::Mesh::loop();
|
||||
if (profiles.saveDue()) savePrefs();
|
||||
|
||||
if (next_flood_advert && millisHasNowPassed(next_flood_advert)) {
|
||||
mesh::Packet* pkt = createSelfAdvert();
|
||||
|
||||
Reference in new issue
Block a user