From b0a6c8929ce80ec8479bfb7fedbea58db5c5d035 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Mon, 6 Dec 2021 21:01:18 -0800 Subject: [PATCH] Save partial work for S&F --- src/plugins/esp32/StoreForwardPlugin.cpp | 13 ++++--------- src/plugins/esp32/StoreForwardPlugin.h | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/plugins/esp32/StoreForwardPlugin.cpp b/src/plugins/esp32/StoreForwardPlugin.cpp index 95f5be2e1..39ad50148 100644 --- a/src/plugins/esp32/StoreForwardPlugin.cpp +++ b/src/plugins/esp32/StoreForwardPlugin.cpp @@ -38,9 +38,8 @@ int32_t StoreForwardPlugin::runOnce() this->packetHistoryTXQueue_index++; } } + DEBUG_MSG("SF myNodeInfo.bitrate = %f bytes / sec\n", myNodeInfo.bitrate); - // TODO: Dynamicly adjust the time this returns in the loop based on the size of the packets being actually - // transmitted. return (this->packetTimeMax); } else { DEBUG_MSG("Store & Forward Plugin - Disabled (is_router = false)\n"); @@ -408,13 +407,9 @@ StoreForwardPlugin::StoreForwardPlugin() // Popupate PSRAM with our data structures. this->populatePSRAM(); - // Calculate the packet time. - // this->packetTimeMax = RadioLibInterface::instance->getPacketTime(Constants_DATA_PAYLOAD_LEN); - // RadioLibInterface::instance->getPacketTime(Constants_DATA_PAYLOAD_LEN); - // RadioLibInterface::instance->getPacketTime(Constants_DATA_PAYLOAD_LEN); - // RadioInterface::getPacketTime(500)l - - this->packetTimeMax = 2000; + + //this->packetTimeMax = 2000; + //DEBUG_MSG("SF Time to Transmit maxPacketSize (%d bytes) %d ms\n", maxPacketSize, this->packetTimeMax); } else { DEBUG_MSG("Device has less than 1M of PSRAM free. Aborting startup.\n"); diff --git a/src/plugins/esp32/StoreForwardPlugin.h b/src/plugins/esp32/StoreForwardPlugin.h index 1f164171f..65b4f1897 100644 --- a/src/plugins/esp32/StoreForwardPlugin.h +++ b/src/plugins/esp32/StoreForwardPlugin.h @@ -33,7 +33,7 @@ class StoreForwardPlugin : public SinglePortPlugin, private concurrency::OSThrea uint32_t packetHistoryTXQueue_size; uint32_t packetHistoryTXQueue_index = 0; - uint32_t packetTimeMax = 0; + uint32_t packetTimeMax = 2000; public: StoreForwardPlugin();