mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 14:46:12 -04:00
Change comment "WIFI" to "WiFi"
PiperOrigin-RevId: 451659534
This commit is contained in:
@@ -184,7 +184,7 @@ class WifiHotspotMedium : public api::WifiHotspotMedium {
|
||||
WifiHotspotMedium& operator=(const WifiHotspotMedium&) = delete;
|
||||
WifiHotspotMedium& operator=(WifiHotspotMedium&&) = delete;
|
||||
|
||||
// If the WIFI Adaptor supports to start a Hotspot interface.
|
||||
// If the WiFi Adaptor supports to start a Hotspot interface.
|
||||
bool IsInterfaceValid() const override { return true;}
|
||||
|
||||
// Discoverer connects to server socket
|
||||
@@ -196,9 +196,9 @@ class WifiHotspotMedium : public api::WifiHotspotMedium {
|
||||
std::unique_ptr<api::WifiHotspotServerSocket> ListenForService(
|
||||
int port) override;
|
||||
|
||||
// Advertiser start WIFI Hotspot with specific Crendentials
|
||||
// Advertiser start WiFi Hotspot with specific Crendentials
|
||||
bool StartWifiHotspot(HotspotCredentials* hotspot_credentials) override;
|
||||
// Advertiser stop the current WIFI Hotspot
|
||||
// Advertiser stop the current WiFi Hotspot
|
||||
bool StopWifiHotspot() override;
|
||||
// Discoverer connects to the Hotspot
|
||||
bool ConnectWifiHotspot(HotspotCredentials* hotspot_credentials) override;
|
||||
|
||||
@@ -46,7 +46,7 @@ enum class WifiConnectionStatus {
|
||||
kAuthFailure = 3,
|
||||
};
|
||||
|
||||
// WIFI Band type.
|
||||
// WiFi Band type.
|
||||
enum class WifiBandType {
|
||||
kUnknown = 0,
|
||||
kBand24Ghz = 1,
|
||||
@@ -55,15 +55,15 @@ enum class WifiBandType {
|
||||
kBand60Ghz = 4,
|
||||
};
|
||||
|
||||
// Native WIFI's capablity parameters
|
||||
// Native WiFi's capablity parameters
|
||||
struct WifiCapability {
|
||||
bool supports_5_ghz = false;
|
||||
bool supports_6_ghz = false;
|
||||
};
|
||||
|
||||
// Native WIFI's information parameters
|
||||
// Native WiFi's information parameters
|
||||
struct WifiInformation {
|
||||
// Is this WIFI interface connected to AP or not
|
||||
// Is this WiFi interface connected to AP or not
|
||||
bool is_connected;
|
||||
// AP's SSID if connected
|
||||
std::string ssid;
|
||||
|
||||
@@ -74,7 +74,7 @@ class WifiHotspotMedium {
|
||||
public:
|
||||
virtual ~WifiHotspotMedium() = default;
|
||||
|
||||
// If the WIFI Adaptor supports to start a Hotspot interface.
|
||||
// If the WiFi Adaptor supports to start a Hotspot interface.
|
||||
virtual bool IsInterfaceValid() const = 0;
|
||||
|
||||
// Connects to a WifiHotspot service by ip address and port.
|
||||
|
||||
@@ -114,7 +114,7 @@ class WifiMedium : public api::WifiMedium {
|
||||
std::string GetIpAddress() override;
|
||||
|
||||
private:
|
||||
// Since the WIFI interface capability won't change in the connection session,
|
||||
// Since the WiFi interface capability won't change in the connection session,
|
||||
// we only need to querry it once at the beginning
|
||||
void InitCapability();
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ class WifiHotspotMedium : public api::WifiHotspotMedium {
|
||||
WifiHotspotMedium();
|
||||
~WifiHotspotMedium() override;
|
||||
|
||||
// If the WIFI Adaptor supports to start a Hotspot interface.
|
||||
// If the WiFi Adaptor supports to start a Hotspot interface.
|
||||
bool IsInterfaceValid() const override;
|
||||
|
||||
// Discoverer connects to server socket
|
||||
@@ -228,9 +228,9 @@ class WifiHotspotMedium : public api::WifiHotspotMedium {
|
||||
std::unique_ptr<api::WifiHotspotServerSocket> ListenForService(
|
||||
int port) override;
|
||||
|
||||
// Advertiser start WIFI Hotspot with specific Crendentials
|
||||
// Advertiser start WiFi Hotspot with specific Crendentials
|
||||
bool StartWifiHotspot(HotspotCredentials* hotspot_credentials_) override;
|
||||
// Advertiser stop the current WIFI Hotspot
|
||||
// Advertiser stop the current WiFi Hotspot
|
||||
bool StopWifiHotspot() override;
|
||||
// Discoverer connects to the Hotspot
|
||||
bool ConnectWifiHotspot(HotspotCredentials* hotspot_credentials_) override;
|
||||
|
||||
@@ -180,14 +180,14 @@ bool WifiHotspotMedium::StartWifiHotspot(
|
||||
|
||||
publisher_.Start();
|
||||
if (publisher_.Status() == WiFiDirectAdvertisementPublisherStatus::Started) {
|
||||
NEARBY_LOGS(INFO) << "Windows WIFI Hotspot started";
|
||||
NEARBY_LOGS(INFO) << "Windows WiFi Hotspot started";
|
||||
medium_status_ |= kMediumStatusBeaconing;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Clean up when fail
|
||||
NEARBY_LOGS(ERROR) << "Windows WIFI Hotspot fails to start";
|
||||
NEARBY_LOGS(ERROR) << "Windows WiFi Hotspot fails to start";
|
||||
listener_ = nullptr;
|
||||
publisher_ = nullptr;
|
||||
return false;
|
||||
@@ -206,7 +206,7 @@ bool WifiHotspotMedium::StopWifiHotspot() {
|
||||
publisher_.Stop();
|
||||
publisher_.StatusChanged(publisher_status_changed_token_);
|
||||
listener_.ConnectionRequested(connection_requested_token_);
|
||||
NEARBY_LOGS(INFO) << "succeeded to stop WIFI Hotspot";
|
||||
NEARBY_LOGS(INFO) << "succeeded to stop WiFi Hotspot";
|
||||
}
|
||||
medium_status_ &= (~kMediumStatusBeaconing);
|
||||
return true;
|
||||
@@ -218,10 +218,10 @@ fire_and_forget WifiHotspotMedium::OnStatusChanged(
|
||||
if (event.Status() == WiFiDirectAdvertisementPublisherStatus::Started) {
|
||||
if (sender.Advertisement().LegacySettings().IsEnabled()) {
|
||||
NEARBY_LOGS(INFO)
|
||||
<< "WIFI SoftAP SSID: "
|
||||
<< "WiFi SoftAP SSID: "
|
||||
<< winrt::to_string(
|
||||
publisher_.Advertisement().LegacySettings().Ssid());
|
||||
NEARBY_LOGS(INFO) << "WIFI SoftAP PW: "
|
||||
NEARBY_LOGS(INFO) << "WiFi SoftAP PW: "
|
||||
<< winrt::to_string(publisher_.Advertisement()
|
||||
.LegacySettings()
|
||||
.Passphrase()
|
||||
@@ -229,7 +229,7 @@ fire_and_forget WifiHotspotMedium::OnStatusChanged(
|
||||
}
|
||||
}
|
||||
if (event.Status() == WiFiDirectAdvertisementPublisherStatus::Stopped) {
|
||||
NEARBY_LOGS(INFO) << "Receive WIFI direct/SoftAP stop event";
|
||||
NEARBY_LOGS(INFO) << "Receive WiFi direct/SoftAP stop event";
|
||||
}
|
||||
return winrt::fire_and_forget();
|
||||
}
|
||||
@@ -270,7 +270,7 @@ bool WifiHotspotMedium::ConnectWifiHotspot(
|
||||
|
||||
auto adaptors = WiFiAdapter::FindAllAdaptersAsync().get();
|
||||
if (adaptors.Size() < 1) {
|
||||
NEARBY_LOGS(WARNING) << "No WIFI Adaptor found.";
|
||||
NEARBY_LOGS(WARNING) << "No WiFi Adaptor found.";
|
||||
return false;
|
||||
}
|
||||
wifi_adapter_ = adaptors.GetAt(0);
|
||||
|
||||
@@ -131,7 +131,7 @@ api::WifiInformation& WifiMedium::GetInformation() {
|
||||
for (int i = 0; i < (int)p_intf_list->dwNumberOfItems; i++) {
|
||||
p_intf_info = (WLAN_INTERFACE_INFO*)&p_intf_list->InterfaceInfo[i];
|
||||
if (p_intf_info->isState == wlan_interface_state_connected) {
|
||||
NEARBY_LOGS(INFO) << "Found connected WIFI interface No: " << i;
|
||||
NEARBY_LOGS(INFO) << "Found connected WiFi interface No: " << i;
|
||||
wifi_information_.is_connected = true;
|
||||
|
||||
DWORD channel_size;
|
||||
@@ -213,7 +213,7 @@ std::string WifiMedium::GetIpAddress() {
|
||||
if ( wifi_information_.ssid == winrt::to_string(
|
||||
profile.WlanConnectionProfileDetails().GetConnectedSsid())) {
|
||||
NEARBY_LOGS(INFO)
|
||||
<< "SSID of this IP matches with this WIFI interface's SSID:"
|
||||
<< "SSID of this IP matches with this WiFi interface's SSID:"
|
||||
<< wifi_information_.ssid << ", return this IP";
|
||||
return ipv4_s;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user