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

Method get_use_5g_channel

OpenHD/ohd_interface/src/wifi_hotspot.cpp:142–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142bool WifiHotspot::get_use_5g_channel(
143 const WiFiCard& wifiCard,
144 const openhd::WifiSpace& wifibroadcast_frequency_space) {
145 const bool wifibroadcast_uses_5G =
146 wifibroadcast_frequency_space == openhd::WifiSpace::G5_8;
147 bool should_use_5G = !wifibroadcast_uses_5G;
148 if (should_use_5G && !wifiCard.supports_5GHz()) {
149 openhd::log::get_default()->debug(
150 "openhd needs 5G hotspot but hotspot card only supports 2G,you'l get "
151 "really bad interference");
152 openhd::log::get_default()->debug("Using 2.4G hotspot");
153 should_use_5G = false;
154 }
155 // Not seen a 5G only card yet
156 return should_use_5G;
157}
158
159uint16_t WifiHotspot::get_frequency() {
160 if (m_use_5G_channel) return 5180;

Callers

nothing calls this directly

Calls 2

supports_5GHzMethod · 0.80
debugMethod · 0.80

Tested by

no test coverage detected