mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Apply GO frequency to NC that queries from Intel PIE SDK
PiperOrigin-RevId: 569558266
This commit is contained in:
@@ -65,6 +65,10 @@ constexpr auto kWifiHotspotConnectionIntervalMillis =
|
||||
constexpr auto kWifiHotspotConnectionTimeoutMillis =
|
||||
flags::Flag<int64_t>(kConfigPackage, "45415888", 10000);
|
||||
|
||||
// Enable/Disable Intel PIe SDK to query/set WIFI feature.
|
||||
constexpr auto kEnableIntelPieSdk =
|
||||
flags::Flag<bool>(kConfigPackage, "45428547", false);
|
||||
|
||||
} // namespace nearby_platform_feature
|
||||
} // namespace config_package_nearby
|
||||
} // namespace platform
|
||||
|
||||
@@ -20,16 +20,17 @@
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "absl/time/time.h"
|
||||
#include "internal/platform/feature_flags.h"
|
||||
#include "internal/platform/flags/nearby_platform_feature_flags.h"
|
||||
#include "internal/platform/implementation/windows/wifi_hotspot.h"
|
||||
#include "internal/platform/implementation/windows/wifi_intel.h"
|
||||
|
||||
// Nearby connections headers
|
||||
#include "internal/flags/nearby_flags.h"
|
||||
#include "internal/platform/cancellation_flag_listener.h"
|
||||
#include "internal/platform/implementation/windows/utils.h"
|
||||
#include "internal/platform/logging.h"
|
||||
#include "internal/platform/wifi_utils.h"
|
||||
|
||||
namespace nearby {
|
||||
namespace windows {
|
||||
@@ -256,6 +257,20 @@ bool WifiHotspotMedium::StartWifiHotspot(
|
||||
WiFiDirectAdvertisementPublisherStatus::Started) {
|
||||
NEARBY_LOGS(INFO) << __func__ << ": WiFi Hotspot created and started.";
|
||||
medium_status_ |= kMediumStatusBeaconing;
|
||||
if (NearbyFlags::GetInstance().GetBoolFlag(
|
||||
platform::config_package_nearby::nearby_platform_feature::
|
||||
kEnableIntelPieSdk)) {
|
||||
WifiIntel& intel_wifi{WifiIntel::GetInstance()};
|
||||
intel_wifi.Start();
|
||||
int GO_channel = static_cast<int>(intel_wifi.GetGOChannel());
|
||||
NEARBY_LOGS(INFO) << "Hotspot is running on channel: " << GO_channel;
|
||||
intel_wifi.Stop();
|
||||
hotspot_credentials_->SetFrequency(
|
||||
WifiUtils::ConvertChannelToFrequencyMhz(GO_channel,
|
||||
WifiBandType::kUnknown));
|
||||
} else {
|
||||
hotspot_credentials_->SetFrequency(-1);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -428,7 +428,7 @@ HINSTANCE WifiIntel::PIEDllLoader() {
|
||||
// load the library and get the handle
|
||||
murocApiDllHandle = LoadLibraryW(pDllPathValue); // NOLINT
|
||||
|
||||
NEARBY_LOGS(INFO) << absl::StrFormat("Muroc Api Dll Handle is 0x%p ",
|
||||
NEARBY_LOGS(VERBOSE) << absl::StrFormat("Muroc Api Dll Handle is 0x%p ",
|
||||
murocApiDllHandle);
|
||||
} else {
|
||||
NEARBY_LOGS(INFO) << "GetFullDllLoadPathFromPieRegistry fails eith error: "
|
||||
@@ -458,7 +458,7 @@ HADAPTER WifiGetAdapterList(HINSTANCE murocApiDllHandle,
|
||||
return INVALID_HADAPTER;
|
||||
}
|
||||
|
||||
NEARBY_LOGS(INFO) << "GetProcAddress for WifiGetAdapterListFunction API "
|
||||
NEARBY_LOGS(VERBOSE) << "GetProcAddress for WifiGetAdapterListFunction API "
|
||||
"completed successfully";
|
||||
INTEL_WIFI_HEADER intelHeader = {INTEL_STRUCT_VERSION_V156, // NOLINT
|
||||
sizeof(MurocDefs::INTEL_ADAPTER_LIST_V120)};
|
||||
@@ -475,7 +475,7 @@ HADAPTER WifiGetAdapterList(HINSTANCE murocApiDllHandle,
|
||||
}
|
||||
|
||||
firstAdapterOnTheList = (*ppAllAdapters)->adapter[0].hAdapter;
|
||||
NEARBY_LOGS(INFO) << "Return WIFI Adapter: " << firstAdapterOnTheList;
|
||||
NEARBY_LOGS(INFO) << "WIFI Adapter on the list: " << firstAdapterOnTheList;
|
||||
|
||||
return firstAdapterOnTheList;
|
||||
}
|
||||
@@ -532,7 +532,7 @@ void DeregisterIntelCallback(HINSTANCE murocApiDllHandle,
|
||||
murocApiRetVal = deregisterIntelCBFunc(fnCallback);
|
||||
|
||||
if (murocApiRetVal == IWLAN_E_SUCCESS) {
|
||||
NEARBY_LOGS(INFO) << "Calling DeregisterIntelCallback API succeeded.";
|
||||
NEARBY_LOGS(VERBOSE) << "Calling DeregisterIntelCallback API succeeded.";
|
||||
} else {
|
||||
NEARBY_LOGS(INFO)
|
||||
<< "Calling DeregisterIntelCallback API fails with error:"
|
||||
@@ -566,7 +566,7 @@ void FreeMemoryList(HINSTANCE murocApiDllHandle, void* ptr) {
|
||||
murocApiRetVal = freeMemoryListFunction(ptr);
|
||||
|
||||
if (murocApiRetVal == IWLAN_E_SUCCESS) {
|
||||
NEARBY_LOGS(INFO) << "Calling FreeListMemory API succeeded.";
|
||||
NEARBY_LOGS(VERBOSE) << "Calling FreeListMemory API succeeded.";
|
||||
} else {
|
||||
NEARBY_LOGS(INFO) << "Calling FreeListMemory API failed with error: "
|
||||
<< murocApiRetVal;
|
||||
|
||||
@@ -59,6 +59,8 @@ class HotspotCredentials {
|
||||
|
||||
// Gets the Frequency
|
||||
int GetFrequency() const { return frequency_; }
|
||||
// Set frequency_
|
||||
void SetFrequency(int frequency) { frequency_ = frequency; }
|
||||
|
||||
// Gets the Band
|
||||
location::nearby::proto::connections::ConnectionBand GetBand() const {
|
||||
|
||||
Reference in New Issue
Block a user