7#include <boost/asio/awaitable.hpp>
8#include <boost/asio/buffer.hpp>
9#include <boost/asio/use_awaitable.hpp>
13#include <fmt/ranges.h>
16#include <spdlog/spdlog.h>
22 -> asio::awaitable<void>
24 spdlog::debug(
"Connection {}: Sending data using external socket at time {} us...",
26 socket->get_time_us());
27 auto data_size =
co_await socket->get_socket().async_send_to(
28 asio::buffer(
connection->write_msg_buffer_.data()),
connection->remote_endpoint_, asio::use_awaitable);
29 spdlog::debug(
"Connection {}: {} bytes data sent to the remote endpoint {} at time {} us: \n\t{:02x}",
33 socket->get_time_us(),
34 fmt::join(
connection->write_msg_buffer_.data(),
" "));
40 std::span<const CommunicateEntryType> data,
57 spdlog::trace(
"write_msg_response_buffer is empty!");
process::SerializableMsgBuffer write_msg_response_buffer_
static auto send_message(std::shared_ptr< FecCommandSocket > socket, std::shared_ptr< CommandBase > connection) -> asio::awaitable< void >
auto check_response(std::span< char > response_msg) const -> bool
static void encode_write_msg(process::SerializableMsgBuffer &buffer, uint32_t counter, std::span< const CommunicateEntryType > data, uint16_t address)
auto serialize(auto &&... structs)
constexpr auto WRITE_COMMAND_BITS
constexpr auto DEFAULT_TYPE_BITS
constexpr auto ZERO_UINT16_PADDING
constexpr auto COMMAND_LENGTH_BITS