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

Method initialize_air_unit

OpenHD/ohd_interface/src/ethernet_link.cpp:87–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87void 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
104void EthernetLink::initialize_ground_unit() {
105 // Initialize video receiver for receiving video from the air unit

Callers

nothing calls this directly

Calls 1

runInBackgroundMethod · 0.80

Tested by

no test coverage detected