| 406 | } |
| 407 | |
| 408 | static void wait_for_microhard_module(bool is_air) { |
| 409 | const std::string microhard_device_ip = get_gateway_ip(); |
| 410 | |
| 411 | if (microhard_device_ip.empty()) { |
| 412 | openhd::log::get_default()->warn( |
| 413 | "No microhard device IP address detected. Exiting."); |
| 414 | return; |
| 415 | } |
| 416 | |
| 417 | while (true) { |
| 418 | if (check_ip_alive(microhard_device_ip)) { |
| 419 | openhd::log::get_default()->warn("Microhard module found at {}", |
| 420 | microhard_device_ip); |
| 421 | break; |
| 422 | } |
| 423 | std::this_thread::sleep_for(std::chrono::seconds(1)); |
| 424 | } |
| 425 | } |
| 426 | |
| 427 | MicrohardLink::MicrohardLink(OHDProfile profile) : m_profile(profile) { |
| 428 | wait_for_microhard_module(m_profile.is_air); |
no test coverage detected