| 552 | } |
| 553 | |
| 554 | bool WBLink::apply_frequency_and_channel_width(int frequency, |
| 555 | int channel_width_rx, |
| 556 | int channel_width_tx) { |
| 557 | m_console->debug("apply_frequency_and_channel_width {}Mhz RX:{}Mhz TX:{}Mhz", |
| 558 | frequency, channel_width_rx, channel_width_tx); |
| 559 | // Weird bug hunting - I hope this makes the driver less likely too crash |
| 560 | // Temporarily stop injecting packets |
| 561 | m_wb_txrx->set_passive_mode(true); |
| 562 | std::this_thread::sleep_for(std::chrono::milliseconds( |
| 563 | 100)); // Dirty - wait for any tx packets to drain |
| 564 | const auto res = openhd::wb::set_frequency_and_channel_width_for_all_cards( |
| 565 | frequency, channel_width_rx, m_broadcast_cards); |
| 566 | m_tx_header_1->update_channel_width(channel_width_tx); |
| 567 | m_wb_txrx->tx_reset_stats(); |
| 568 | m_wb_txrx->rx_reset_stats(); |
| 569 | re_enable_injection_unless_user_passive_mode_enabled(); |
| 570 | return res; |
| 571 | } |
| 572 | |
| 573 | bool WBLink::apply_frequency_and_channel_width_from_settings() { |
| 574 | const auto settings = m_settings->get_settings(); |