Send more metadata

This commit is contained in:
2025-10-16 21:24:41 -04:00
parent 9a0017d87f
commit cfc02dd1d2
7 changed files with 36 additions and 10 deletions

View File

@@ -55,15 +55,11 @@ public:
[[noreturn]] static void router_thread(void *args);
[[noreturn]] static void link_layer_thread(void *args);
int send_msg(char* buffer, size_t length) const;
void update_leader();
void route(uint8_t *buffer, size_t length) const;
// pair of <module, mount orientation>
std::pair<std::vector<uint8_t>, std::vector<Orientation>> get_physically_connected_modules() const;
[[nodiscard]] std::pair<std::vector<uint8_t>, std::vector<Orientation>> get_physically_connected_modules() const;
[[nodiscard]] uint8_t get_leader() const;
// todo: does this really need to be here (so i can access from thread)?
std::shared_ptr<PtrQueue<std::vector<uint8_t>>> m_tcp_rx_queue;

View File

@@ -7,6 +7,7 @@
#include <memory>
#include <unordered_map>
#include <flatbuffers_generated/TopologyMessage_generated.h>
#include "constants/app_comms.h"
#include "CommunicationRouter.h"
@@ -26,6 +27,8 @@ public:
int recv(char* buffer, int size, int source, int tag);
int sendrecv(char* send_buffer, int send_size, int dest, int send_tag, char* recv_buffer, int recv_size, int recv_tag);
std::pair<std::vector<uint8_t>, std::vector<Orientation>> get_physically_connected_modules() const;
Messaging::ConnectionType get_connection_type() const;
uint8_t get_leader() const;
private:
void handleRecv(const char* recv_buffer, int recv_size);