串口改协程前

This commit is contained in:
2026-06-23 11:00:00 +08:00
parent 3a4a3abe3f
commit 8ca05115ec
5 changed files with 153 additions and 38 deletions
+11 -1
View File
@@ -1,7 +1,17 @@
#include "Local_Server/Data_Feed/Data_Feed.h"
#include "../server/Global.h"
void Data_Feed_UDP_Server::handle_in_loop() {
ucoro::sync_await(svr.tick_coro());
ucoro::sync_await(handle_in_loop_coro());
}
ucoro::awaitable<void> Data_Feed_UDP_Server::handle_in_loop_coro() {
co_await svr.tick_coro();
co_return;
}
ucoro::awaitable<void> Data_Feed_UDP_Server::send_coro(const std::string& data) {
co_await svr.write_to_all_clients_coro(data);
co_return;
}
bool Data_Feed_UDP_Server::_open() {
svr.set_bind_address("0.0.0.0", port);