Use SD card as store&forward memory

This commit is contained in:
Thomas Göttgens
2024-10-16 21:11:24 +02:00
parent f77c87dca8
commit b1125513f3
8 changed files with 180 additions and 64 deletions

View File

@@ -9,6 +9,10 @@
#include <functional>
#include <unordered_map>
#ifdef HAS_SDCARD
#include <SD.h>
#endif
struct PacketHistoryStruct {
uint32_t time;
uint32_t to;
@@ -18,6 +22,9 @@ struct PacketHistoryStruct {
pb_size_t payload_size;
};
// enum for the storage type
enum StorageType { PSRAM, SDCARD };
class StoreForwardModule : private concurrency::OSThread, public ProtobufModule<meshtastic_StoreAndForward>
{
bool busy = 0;
@@ -80,6 +87,10 @@ class StoreForwardModule : private concurrency::OSThread, public ProtobufModule<
private:
void populatePSRAM();
void populateSDCard();
// Storage Type
StorageType storageType = PSRAM;
// S&F Defaults
uint32_t historyReturnMax = 25; // Return maximum of 25 records by default.