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

Method update_wifi_hotspot_enable

OpenHD/ohd_interface/src/ohd_interface.cpp:272–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270}
271
272void 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}

Callers

nothing calls this directly

Calls 3

is_currently_armedMethod · 0.80
set_enabled_asyncMethod · 0.80
get_frequencyMethod · 0.80

Tested by

no test coverage detected