diff --git a/bin/config-dist.yaml b/bin/config-dist.yaml index 7f0b700faa..1cd219c4ce 100644 --- a/bin/config-dist.yaml +++ b/bin/config-dist.yaml @@ -151,4 +151,5 @@ Webserver: # RootPath: /usr/share/doc/meshtasticd/web # Root Dir of WebServer General: - MaxNodes: 200 \ No newline at end of file + MaxNodes: 200 + MaxMessageQueue: 100 \ No newline at end of file diff --git a/src/mesh/MeshService.cpp b/src/mesh/MeshService.cpp index 1181ffb9a8..084f57ff42 100644 --- a/src/mesh/MeshService.cpp +++ b/src/mesh/MeshService.cpp @@ -23,6 +23,10 @@ #include "nimble/NimbleBluetooth.h" #endif +#if ARCH_PORTDUINO +#include "PortduinoGlue.h" +#endif + /* receivedPacketQueue - this is a queue of messages we've received from the mesh, which we are keeping to deliver to the phone. It is implemented with a FreeRTos queue (wrapped with a little RTQueue class) of pointers to MeshPacket protobufs (which were diff --git a/src/mesh/mesh-pb-constants.h b/src/mesh/mesh-pb-constants.h index b8ef236c99..f91c485605 100644 --- a/src/mesh/mesh-pb-constants.h +++ b/src/mesh/mesh-pb-constants.h @@ -14,7 +14,9 @@ /// max number of packets which can be waiting for delivery to android - note, this value comes from mesh.options protobuf // FIXME - max_count is actually 32 but we save/load this as one long string of preencoded MeshPacket bytes - not a big array in // RAM #define MAX_RX_TOPHONE (member_size(DeviceState, receive_queue) / member_size(DeviceState, receive_queue[0])) +#ifndef MAX_RX_TOPHONE #define MAX_RX_TOPHONE 32 +#endif /// max number of nodes allowed in the mesh #ifndef MAX_NUM_NODES diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index 99d5c90e4e..dc7a9ed619 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -282,6 +282,7 @@ void portduinoSetup() } settingsMap[maxnodes] = (yamlConfig["General"]["MaxNodes"]).as(200); + settingsMap[maxtophone] = (yamlConfig["General"]["MaxMessageQueue"]).as(100); } catch (YAML::Exception &e) { std::cout << "*** Exception " << e.what() << std::endl; diff --git a/src/platform/portduino/PortduinoGlue.h b/src/platform/portduino/PortduinoGlue.h index bd18a76ea5..0c81b8686d 100644 --- a/src/platform/portduino/PortduinoGlue.h +++ b/src/platform/portduino/PortduinoGlue.h @@ -52,6 +52,7 @@ enum configNames { webserver, webserverport, webserverrootpath, + maxtophone, maxnodes }; enum { no_screen, x11, st7789, st7735, st7735s, st7796, ili9341, ili9488, hx8357d }; diff --git a/variants/portduino/variant.h b/variants/portduino/variant.h index 414a3fa566..70d7cbd526 100644 --- a/variants/portduino/variant.h +++ b/variants/portduino/variant.h @@ -1,5 +1,6 @@ #define HAS_SCREEN 1 #define CANNED_MESSAGE_MODULE_ENABLE 1 #define HAS_GPS 1 +#define MAX_RX_TOPHONE settingsMap[maxtophone] #define MAX_NUM_NODES settingsMap[maxnodes] #define RADIOLIB_GODMODE 1