| 85 | } |
| 86 | |
| 87 | void EthernetLink::initialize_air_unit() { |
| 88 | // Initialize video transmitter for sending video to the ground unit |
| 89 | m_video_tx = |
| 90 | std::make_unique<openhd::UDPForwarder>(GROUND_UNIT_IP, VIDEO_PORT); |
| 91 | |
| 92 | // Initialize telemetry transmitter and receiver for bidirectional telemetry |
| 93 | m_telemetry_tx = |
| 94 | std::make_unique<openhd::UDPForwarder>(GROUND_UNIT_IP, TELEMETRY_PORT); |
| 95 | m_telemetry_rx = std::make_unique<openhd::UDPReceiver>( |
| 96 | "0.0.0.0", TELEMETRY_PORT, [this](const uint8_t* data, std::size_t len) { |
| 97 | handle_telemetry_data(data, len); // Process incoming telemetry |
| 98 | }); |
| 99 | |
| 100 | // Start telemetry receiver in the background |
| 101 | if (m_telemetry_rx) m_telemetry_rx->runInBackground(); |
| 102 | } |
| 103 | |
| 104 | void EthernetLink::initialize_ground_unit() { |
| 105 | // Initialize video receiver for receiving video from the air unit |
nothing calls this directly
no test coverage detected