mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-24 22:02:30 +00:00
Merge branch 'master' into ExternalNotificationFix
This commit is contained in:
commit
0812094f35
@ -3,6 +3,7 @@
|
|||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "RTC.h"
|
#include "RTC.h"
|
||||||
#include "Router.h"
|
#include "Router.h"
|
||||||
|
#include "airtime.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "mesh-pb-constants.h"
|
#include "mesh-pb-constants.h"
|
||||||
#include "mesh/generated/storeforward.pb.h"
|
#include "mesh/generated/storeforward.pb.h"
|
||||||
@ -22,8 +23,12 @@ int32_t StoreForwardPlugin::runOnce()
|
|||||||
|
|
||||||
if (radioConfig.preferences.is_router) {
|
if (radioConfig.preferences.is_router) {
|
||||||
|
|
||||||
if (this->busy) {
|
|
||||||
// Send out the message queue.
|
// Send out the message queue.
|
||||||
|
if (this->busy) {
|
||||||
|
|
||||||
|
|
||||||
|
// Only send packets if the channel is less than 25% utilized.
|
||||||
|
if (airTime->channelUtilizationPercent() < 25) {
|
||||||
|
|
||||||
// DEBUG_MSG("--- --- --- In busy loop 1 %d\n", this->packetHistoryTXQueue_index);
|
// DEBUG_MSG("--- --- --- In busy loop 1 %d\n", this->packetHistoryTXQueue_index);
|
||||||
storeForwardPlugin->sendPayload(this->busyTo, this->packetHistoryTXQueue_index);
|
storeForwardPlugin->sendPayload(this->busyTo, this->packetHistoryTXQueue_index);
|
||||||
@ -31,12 +36,17 @@ int32_t StoreForwardPlugin::runOnce()
|
|||||||
if (this->packetHistoryTXQueue_index == packetHistoryTXQueue_size) {
|
if (this->packetHistoryTXQueue_index == packetHistoryTXQueue_size) {
|
||||||
strcpy(this->routerMessage, "** S&F - Done");
|
strcpy(this->routerMessage, "** S&F - Done");
|
||||||
storeForwardPlugin->sendMessage(this->busyTo, this->routerMessage);
|
storeForwardPlugin->sendMessage(this->busyTo, this->routerMessage);
|
||||||
|
|
||||||
// DEBUG_MSG("--- --- --- In busy loop - Done \n");
|
// DEBUG_MSG("--- --- --- In busy loop - Done \n");
|
||||||
this->packetHistoryTXQueue_index = 0;
|
this->packetHistoryTXQueue_index = 0;
|
||||||
this->busy = false;
|
this->busy = false;
|
||||||
} else {
|
} else {
|
||||||
this->packetHistoryTXQueue_index++;
|
this->packetHistoryTXQueue_index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
DEBUG_MSG("Channel utilization is too high. Skipping this opportunity to send and will retry later.\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
DEBUG_MSG("SF myNodeInfo.bitrate = %f bytes / sec\n", myNodeInfo.bitrate);
|
DEBUG_MSG("SF myNodeInfo.bitrate = %f bytes / sec\n", myNodeInfo.bitrate);
|
||||||
|
|
||||||
@ -414,9 +424,6 @@ StoreForwardPlugin::StoreForwardPlugin()
|
|||||||
// Popupate PSRAM with our data structures.
|
// Popupate PSRAM with our data structures.
|
||||||
this->populatePSRAM();
|
this->populatePSRAM();
|
||||||
|
|
||||||
// this->packetTimeMax = 2000;
|
|
||||||
// DEBUG_MSG("SF Time to Transmit maxPacketSize (%d bytes) %d ms\n", maxPacketSize, this->packetTimeMax);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
DEBUG_MSG("Device has less than 1M of PSRAM free. Aborting startup.\n");
|
DEBUG_MSG("Device has less than 1M of PSRAM free. Aborting startup.\n");
|
||||||
DEBUG_MSG("Store & Forward Plugin - Aborting Startup.\n");
|
DEBUG_MSG("Store & Forward Plugin - Aborting Startup.\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user