| 102 | } |
| 103 | |
| 104 | void GroundTelemetry::on_messages_air_unit( |
| 105 | const std::vector<MavlinkMessage>& messages) { |
| 106 | // All messages we get from the Air pi (they might come from the AirPi itself |
| 107 | // or the FC connected to the air pi) get forwarded straight to all the |
| 108 | // client(s) connected to the ground station. |
| 109 | send_messages_ground_station_clients(messages); |
| 110 | // Note: No OpenHD component ever talks to another OpenHD component or the FC, |
| 111 | // so we do not need to do anything else here. tracker serial out - we are |
| 112 | // only interested in message(s) coming from the FC |
| 113 | // 17.April: One exception - timesync |
| 114 | for (const auto& msg : messages) { |
| 115 | if (msg.m.msgid == MAVLINK_MSG_ID_TIMESYNC) { |
| 116 | m_ohd_main_component->handle_timesync_message(msg); |
| 117 | } |
| 118 | } |
| 119 | if (m_endpoint_tracker != nullptr) { |
| 120 | auto msges_from_fc = filter_by_source_sys_id(messages, OHD_SYS_ID_FC); |
| 121 | if (msges_from_fc.empty()) { |
| 122 | msges_from_fc = |
| 123 | filter_by_source_sys_id(messages, OHD_SYS_ID_FC_BETAFLIGHT); |
| 124 | } |
| 125 | if (!msges_from_fc.empty()) { |
| 126 | m_endpoint_tracker->send_messages_if_enabled(msges_from_fc); |
| 127 | } |
| 128 | } |
| 129 | m_ohd_main_component->check_fc_messages_for_actions(messages); |
| 130 | } |
| 131 | |
| 132 | void GroundTelemetry::on_messages_ground_station_clients( |
| 133 | const std::vector<MavlinkMessage>& messages) { |
nothing calls this directly
no test coverage detected