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

Method initialize_ground_unit

OpenHD/ohd_interface/src/ethernet_link.cpp:104–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104void EthernetLink::initialize_ground_unit() {
105 // Initialize video receiver for receiving video from the air unit
106 m_video_rx = std::make_unique<openhd::UDPReceiver>(
107 "0.0.0.0", VIDEO_PORT, [this](const uint8_t* data, std::size_t len) {
108 handle_video_data(0, data, len); // Process incoming video
109 });
110
111 // Initialize telemetry transmitter and receiver for bidirectional telemetry
112 m_telemetry_tx =
113 std::make_unique<openhd::UDPForwarder>(AIR_UNIT_IP, TELEMETRY_PORT);
114 m_telemetry_rx = std::make_unique<openhd::UDPReceiver>(
115 "0.0.0.0", TELEMETRY_PORT, [this](const uint8_t* data, std::size_t len) {
116 handle_telemetry_data(data, len); // Process incoming telemetry
117 });
118
119 // Start video and telemetry receivers in the background
120 if (m_video_rx) m_video_rx->runInBackground();
121 if (m_telemetry_rx) m_telemetry_rx->runInBackground();
122}
123
124void EthernetLink::transmit_telemetry_data(TelemetryTxPacket packet) {
125 // Send telemetry data to the destination

Callers

nothing calls this directly

Calls 1

runInBackgroundMethod · 0.80

Tested by

no test coverage detected