MCPcopy Create free account
hub / github.com/OpenHD/OpenHD / sendMessagesImpl

Method sendMessagesImpl

OpenHD/ohd_telemetry/src/endpoints/TCPEndpoint.cpp:38–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36 : MEndpoint("TCPServer"), openhd::TCPServer("MTCPServer", config) {}
37
38bool TCPEndpoint::sendMessagesImpl(
39 const std::vector<MavlinkMessage>& messages) {
40 auto message_buffers = aggregate_pack_messages(messages, 1024);
41 for (const auto& message_buffer : message_buffers) {
42 const auto& buff = message_buffer.aggregated_data;
43 send_message_to_all_clients(buff->data(), buff->size());
44 }
45 return true;
46}
47
48void TCPEndpoint::on_external_device(std::string ip, int port, bool connected) {
49 auto external_device = openhd::ExternalDevice{"MAV TCP CLIENT", ip, true};

Callers

nothing calls this directly

Calls 2

aggregate_pack_messagesFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected