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

Function wait_for_microhard_module

OpenHD/ohd_interface/src/microhard_link.cpp:408–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406}
407
408static 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
427MicrohardLink::MicrohardLink(OHDProfile profile) : m_profile(profile) {
428 wait_for_microhard_module(m_profile.is_air);

Callers 1

MicrohardLinkMethod · 0.85

Calls 2

get_gateway_ipFunction · 0.85
check_ip_aliveFunction · 0.85

Tested by

no test coverage detected