| 102 | } |
| 103 | |
| 104 | void 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 | |
| 124 | void EthernetLink::transmit_telemetry_data(TelemetryTxPacket packet) { |
| 125 | // Send telemetry data to the destination |
nothing calls this directly
no test coverage detected