mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 14:46:12 -04:00
disabled 5ghz and 6ghz till a workaround for LAR is found or till LAR situation improves.
This commit is contained in:
@@ -147,6 +147,21 @@ bool NetworkManagerWifiHotspotMedium::StartWifiHotspot(
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: starting 5ghz AP with intel devices fail often bcz of LAR. Find a workaround
|
||||
// Get device capabilities to select the best available band
|
||||
// api::WifiCapability& capability = wireless_device_->GetCapability();
|
||||
// std::string selected_band;
|
||||
// if (capability.supports_6_ghz) {
|
||||
// selected_band = "a"; // 5/6 GHz - NetworkManager uses "a" for both 5 GHz and 6 GHz
|
||||
// LOG(INFO) << __func__ << ": Device supports 6 GHz, using 5/6 GHz band";
|
||||
// } else if (capability.supports_5_ghz) {
|
||||
// selected_band = "a"; // 5 GHz
|
||||
// LOG(INFO) << __func__ << ": Device supports 5 GHz, using 5 GHz band";
|
||||
// } else {
|
||||
// selected_band = "bg"; // 2.4 GHz
|
||||
// LOG(INFO) << __func__ << ": Device supports only 2.4 GHz, using 2.4 GHz band";
|
||||
// }
|
||||
|
||||
std::map<std::string, std::map<std::string, sdbus::Variant>>
|
||||
connection_settings{
|
||||
{
|
||||
@@ -160,6 +175,7 @@ bool NetworkManagerWifiHotspotMedium::StartWifiHotspot(
|
||||
{{"assigned-mac-address", "random"},
|
||||
{"ap-isolation", networkmanager::constants::kNMTernaryFalse},
|
||||
{"mode", "ap"},
|
||||
{"band", "bg"},
|
||||
{"ssid", std::vector<uint8_t>(ssid.begin(), ssid.end())},
|
||||
{"security", "802-11-wireless-security"}}},
|
||||
{"802-11-wireless-security",
|
||||
@@ -188,7 +204,7 @@ bool NetworkManagerWifiHotspotMedium::StartWifiHotspot(
|
||||
return false;
|
||||
}
|
||||
|
||||
auto [reason, timeout] = active_conn->WaitForConnection();
|
||||
auto [reason, timeout] = active_conn->WaitForConnection(absl::Seconds(60));
|
||||
if (timeout) {
|
||||
LOG(ERROR)
|
||||
<< __func__ << ": "
|
||||
|
||||
@@ -197,6 +197,8 @@ bool WifiLanMedium::StartDiscovery(
|
||||
}
|
||||
}
|
||||
|
||||
avahi_->SetDiscoveryCallback(std::move(callback));
|
||||
|
||||
try {
|
||||
sdbus::ObjectPath browser_object_path =
|
||||
avahi_->ServiceBrowserPrepare(-1, // AVAHI_IF_UNSPEC
|
||||
@@ -211,7 +213,7 @@ bool WifiLanMedium::StartDiscovery(
|
||||
service_browsers_.emplace(
|
||||
service_type,
|
||||
std::make_unique<avahi::ServiceBrowser>(
|
||||
*system_bus_, browser_object_path, std::move(callback), avahi_));
|
||||
*system_bus_, browser_object_path, avahi_));
|
||||
} catch (const sdbus::Error &e) {
|
||||
DBUS_LOG_METHOD_CALL_ERROR(avahi_, "ServiceBrowserPrepare", e);
|
||||
return false;
|
||||
|
||||
@@ -39,7 +39,8 @@ api::WifiCapability &NetworkManagerWifiMedium::GetCapability() {
|
||||
auto cap_mask = WirelessCapabilities();
|
||||
// https://networkmanager.dev/docs/api/latest/nm-dbus-types.html#NMDeviceWifiCapabilities
|
||||
capability_.supports_5_ghz = (cap_mask & 0x00000400) != 0;
|
||||
capability_.supports_6_ghz = false;
|
||||
// Check for 6 GHz support (NM_WIFI_DEVICE_CAP_FREQ_6GHZ = 0x00008000)
|
||||
capability_.supports_6_ghz = (cap_mask & 0x00008000) != 0;
|
||||
capability_.support_wifi_direct = true;
|
||||
} catch (const sdbus::Error &e) {
|
||||
DBUS_LOG_PROPERTY_GET_ERROR(&getProxy(), "WirelessCapabilities", e);
|
||||
|
||||
Reference in New Issue
Block a user