Skip to content

Commit

Permalink
Make the tophone queue size configurable for Portduino
Browse files Browse the repository at this point in the history
  • Loading branch information
jp-bennett committed Aug 1, 2024
1 parent d6a2a8a commit ad68ab5
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/config-dist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,5 @@ Webserver:
# RootPath: /usr/share/doc/meshtasticd/web # Root Dir of WebServer

General:
MaxNodes: 200
MaxNodes: 200
MaxMessageQueue: 100
4 changes: 4 additions & 0 deletions src/mesh/MeshService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/mesh/mesh-pb-constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/platform/portduino/PortduinoGlue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ void portduinoSetup()
}

settingsMap[maxnodes] = (yamlConfig["General"]["MaxNodes"]).as<int>(200);
settingsMap[maxtophone] = (yamlConfig["General"]["MaxMessageQueue"]).as<int>(100);

} catch (YAML::Exception &e) {
std::cout << "*** Exception " << e.what() << std::endl;
Expand Down
1 change: 1 addition & 0 deletions src/platform/portduino/PortduinoGlue.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ enum configNames {
webserver,
webserverport,
webserverrootpath,
maxtophone,
maxnodes
};
enum { no_screen, x11, st7789, st7735, st7735s, st7796, ili9341, ili9488, hx8357d };
Expand Down
1 change: 1 addition & 0 deletions variants/portduino/variant.h
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ad68ab5

Please sign in to comment.