| 270 | } |
| 271 | |
| 272 | void OHDInterface::update_wifi_hotspot_enable() { |
| 273 | assert(m_wifi_hotspot); |
| 274 | const auto& settings = m_nw_settings.get_settings(); |
| 275 | bool enable_wifi_hotspot = false; |
| 276 | if (settings.wifi_hotspot_mode == WIFI_HOTSPOT_AUTO) { |
| 277 | bool is_armed = openhd::ArmingStateHelper::instance().is_currently_armed(); |
| 278 | enable_wifi_hotspot = !is_armed; |
| 279 | } else if (settings.wifi_hotspot_mode == WIFI_HOTSPOT_ALWAYS_OFF) { |
| 280 | enable_wifi_hotspot = false; |
| 281 | } else if (settings.wifi_hotspot_mode == WIFI_HOTSPOT_ALWAYS_ON) { |
| 282 | enable_wifi_hotspot = true; |
| 283 | } else { |
| 284 | m_console->warn("Invalid wifi hotspot mode"); |
| 285 | enable_wifi_hotspot = false; |
| 286 | } |
| 287 | m_wifi_hotspot->set_enabled_async(enable_wifi_hotspot); |
| 288 | openhd::LinkActionHandler::instance().m_wifi_hotspot_state = |
| 289 | enable_wifi_hotspot ? 2 : 1; |
| 290 | openhd::LinkActionHandler::instance().m_wifi_hotspot_frequency = |
| 291 | m_wifi_hotspot->get_frequency(); |
| 292 | } |
nothing calls this directly
no test coverage detected