Add more log for Intel PIE API calling

PiperOrigin-RevId: 578409693
This commit is contained in:
hai007
2023-10-31 23:20:48 -07:00
committed by Copybara-Service
parent c1e5f47e3f
commit 42043ee856
3 changed files with 10 additions and 5 deletions
@@ -263,12 +263,16 @@ bool WifiHotspotMedium::StartWifiHotspot(
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;
NEARBY_LOGS(INFO)
<< "Intel PIE enabled, Hotspot is running on channel: "
<< GO_channel;
intel_wifi.Stop();
hotspot_credentials_->SetFrequency(
WifiUtils::ConvertChannelToFrequencyMhz(GO_channel,
WifiBandType::kUnknown));
} else {
NEARBY_LOGS(INFO)
<< "Intel PIE disabled, Can't extract Hotspot channel info!";
hotspot_credentials_->SetFrequency(-1);
}
return true;
@@ -34,6 +34,7 @@
#ifndef NO_INTEL_PIE
#include "absl/strings/str_format.h"
#include "third_party/intel/pie/include/PieApiErrors.h"
#include "third_party/intel/pie/include/PieApiTypes.h"
#include "third_party/intel/pie/include/PieDefinitions.h"
#include "third_party/intel/pie/include/PieErrorMacro.h"
@@ -172,11 +173,11 @@ void WifiIntel::Stop() {
#endif
}
uint8_t WifiIntel::GetGOChannel() {
int8_t WifiIntel::GetGOChannel() {
#ifndef NO_INTEL_PIE
WIFIPANQUERYPREFFEDCHANNELSETTING WifiPanQueryPreferredChannelSettingFunc =
nullptr;
uint8_t channel = 0;
int8_t channel = -1;
DWORD dwError = ERROR_SUCCESS; // NOLINT
MUROC_RET murocApiRetVal = IWLAN_E_FAILURE; // NOLINT
INTEL_WIFI_HEADER intelWifiHeader;
@@ -210,7 +211,7 @@ uint8_t WifiIntel::GetGOChannel() {
if (intelGOChan.goState == MurocDefs::INTEL_GO_CURRENT_CHANNEL_ACTIVE) {
channel = intelGOChan.channel;
} else {
NEARBY_LOGS(INFO) << "No active GO found, return 0";
NEARBY_LOGS(INFO) << "No active GO found, return -1";
}
} else {
NEARBY_LOGS(INFO) << "Calling WifiPanQueryPreferredChannelSetting API "
@@ -45,7 +45,7 @@ class WifiIntel {
bool IsValid() const { return intel_wifi_valid_; }
void Start();
void Stop();
uint8_t GetGOChannel();
int8_t GetGOChannel();
private:
// This is a singleton object, for which destructor will never be called.