| 28 | #include "openhd_spdlog_include.h" |
| 29 | |
| 30 | WBEndpoint::WBEndpoint(std::shared_ptr<OHDLink> link, std::string TAG) |
| 31 | : MEndpoint(std::move(TAG)), m_link_handle(std::move(link)) { |
| 32 | // assert(m_tx_rx_handle); |
| 33 | if (!m_link_handle) { |
| 34 | openhd::log::get_default()->warn( |
| 35 | "WBEndpoint-tx rx handle is missing (no telemetry connection between " |
| 36 | "air and ground)"); |
| 37 | } else { |
| 38 | auto cb = [this](std::shared_ptr<std::vector<uint8_t>> data) { |
| 39 | MEndpoint::parseNewData(data->data(), data->size()); |
| 40 | }; |
| 41 | m_link_handle->register_on_receive_telemetry_data_cb(cb); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | WBEndpoint::~WBEndpoint() { |
| 46 | if (m_link_handle) { |
nothing calls this directly
no test coverage detected