Files
firmware/components/rpc/CommunicationRouter.cpp
2026-05-19 23:11:32 -04:00

22 lines
567 B
C++

#include "CommunicationRouter.h"
#include <iostream>
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"
CommunicationRouter::~CommunicationRouter() {
vQueueDelete(m_tcp_rx_queue);
}
[[noreturn]] void CommunicationRouter::router_thread(void *args) {
const auto that = static_cast<CommunicationRouter *>(args);
// todo: change to queue set
char buffer[512];
while (true) {
xQueueReceive(that->m_tcp_rx_queue, buffer, portMAX_DELAY);
that->m_rx_callback(buffer, 512);
std::cout << "callback" << std::endl;
}
}