Reduce DataLink latency

This commit is contained in:
2026-01-27 22:16:24 -05:00
parent 663a7ef262
commit fc25c026b2
25 changed files with 801 additions and 757 deletions

View File

@@ -6,36 +6,37 @@
#define UDPSERVER_H
#include <memory>
#include <vector>
#include <unordered_set>
#include <vector>
#include "freertos/FreeRTOS.h"
#include "IRPCServer.h"
#include "PtrQueue.h"
#include "BlockingQueue.h"
#include "freertos/FreeRTOS.h"
class UDPServer final : public IRPCServer {
public:
UDPServer(int rx_port, int tx_port, const std::shared_ptr<PtrQueue<std::vector<uint8_t>>>& rx_queue);
public:
UDPServer(int rx_port, int tx_port,
const std::shared_ptr<BlockingQueue<std::unique_ptr<std::vector<uint8_t>>>> &rx_queue);
~UDPServer() override;
void startup() override;
void shutdown() override;
int send_msg(char* buffer, uint32_t length) const override;
int send_msg(uint8_t *buffer, size_t size) const override;
private:
private:
bool authenticate_client(int client_sock);
static bool is_network_connected();
[[noreturn]] static void socket_monitor_thread(void *args);
int m_tx_port;
int m_tx_port;
int m_rx_port;
int m_tx_server_sock;
int m_rx_server_sock;
int m_rx_server_sock;
TaskHandle_t m_rx_task;
std::shared_ptr<PtrQueue<std::vector<uint8_t>>> m_rx_queue;
std::shared_ptr<BlockingQueue<std::unique_ptr<std::vector<uint8_t>>>> m_rx_queue;
};
#endif //UDPSERVER_H