mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Update medium log.
PiperOrigin-RevId: 813305935
This commit is contained in:
committed by
Copybara-Service
parent
4fc7c4f93c
commit
04f9204855
@@ -97,6 +97,7 @@ objc_library(
|
||||
"@nlohmann_json//:json",
|
||||
"//internal/base:file_path",
|
||||
"//internal/base:files",
|
||||
"//internal/base:masker",
|
||||
"//internal/platform:base",
|
||||
"//internal/platform/implementation:comm",
|
||||
"//internal/platform/implementation:platform",
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <utility>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include "internal/base/masker.h"
|
||||
#include "internal/platform/cancellation_flag_listener.h"
|
||||
#import "internal/platform/implementation/apple/Log/GNCLogger.h"
|
||||
#import "internal/platform/implementation/apple/Mediums/Hotspot/GNCHotspotMedium.h"
|
||||
@@ -106,10 +107,11 @@ WifiHotspotMedium::~WifiHotspotMedium() { DisconnectWifiHotspot(); }
|
||||
|
||||
bool WifiHotspotMedium::ConnectWifiHotspot(HotspotCredentials* hotspot_credentials_) {
|
||||
NSString* ssid = [[NSString alloc] initWithUTF8String:hotspot_credentials_->GetSSID().c_str()];
|
||||
NSString* password =
|
||||
[[NSString alloc] initWithUTF8String:hotspot_credentials_->GetPassword().c_str()];
|
||||
std::string hotspot_password = hotspot_credentials_->GetPassword();
|
||||
NSString* password = [[NSString alloc] initWithUTF8String:hotspot_password.c_str()];
|
||||
|
||||
GNCLoggerInfo(@"ConnectWifiHotspot SSID: %@ Password: %@", ssid, password);
|
||||
GNCLoggerInfo(@"ConnectWifiHotspot SSID: %@ Password: %s", ssid,
|
||||
masker::Mask(hotspot_password).c_str());
|
||||
bool result = [medium_ connectToWifiNetworkWithSSID:ssid password:password];
|
||||
if (result) {
|
||||
GNCLoggerInfo(@"Successfully connected to %@", ssid);
|
||||
@@ -174,9 +176,9 @@ std::unique_ptr<api::WifiHotspotSocket> WifiHotspotMedium::ConnectToService(
|
||||
}
|
||||
|
||||
GNCNWFrameworkSocket* socket = [medium_ connectToHost:host
|
||||
port:port
|
||||
cancelSource:cancellation_source
|
||||
error:&error];
|
||||
port:port
|
||||
cancelSource:cancellation_source
|
||||
error:&error];
|
||||
if (socket != nil) {
|
||||
return std::make_unique<WifiHotspotSocket>(socket);
|
||||
}
|
||||
|
||||
@@ -276,6 +276,7 @@ cc_library(
|
||||
"//internal/account",
|
||||
"//internal/base:file_path",
|
||||
"//internal/base:files",
|
||||
"//internal/base:masker",
|
||||
"//internal/flags:nearby_flags",
|
||||
"//internal/platform:base",
|
||||
"//internal/platform:cancellation_flag",
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "absl/time/time.h"
|
||||
#include "internal/base/masker.h"
|
||||
#include "internal/platform/cancellation_flag.h"
|
||||
#include "internal/platform/implementation/wifi_direct.h"
|
||||
#include "internal/platform/implementation/wifi_utils.h"
|
||||
@@ -313,11 +314,11 @@ fire_and_forget WifiDirectMedium::OnStatusChanged(
|
||||
LOG(INFO) << "WiFiDirect GO SSID: "
|
||||
<< winrt::to_string(
|
||||
publisher_.Advertisement().LegacySettings().Ssid());
|
||||
LOG(INFO) << "WiFiDirect GO PW: "
|
||||
<< winrt::to_string(publisher_.Advertisement()
|
||||
.LegacySettings()
|
||||
.Passphrase()
|
||||
.Password());
|
||||
LOG(INFO) << "WiFiDirect GO password: "
|
||||
<< masker::Mask(winrt::to_string(publisher_.Advertisement()
|
||||
.LegacySettings()
|
||||
.Passphrase()
|
||||
.Password()));
|
||||
}
|
||||
return winrt::fire_and_forget();
|
||||
} else if (event.Status() ==
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "absl/synchronization/mutex.h"
|
||||
#include "internal/base/masker.h"
|
||||
#include "internal/flags/nearby_flags.h"
|
||||
#include "internal/platform/byte_array.h"
|
||||
#include "internal/platform/cancellation_flag.h"
|
||||
@@ -319,11 +320,11 @@ fire_and_forget WifiHotspotMedium::OnStatusChanged(
|
||||
LOG(INFO) << "WiFi SoftAP SSID: "
|
||||
<< winrt::to_string(
|
||||
publisher_.Advertisement().LegacySettings().Ssid());
|
||||
VLOG(1) << "WiFi SoftAP PW: "
|
||||
<< winrt::to_string(publisher_.Advertisement()
|
||||
.LegacySettings()
|
||||
.Passphrase()
|
||||
.Password());
|
||||
VLOG(1) << "WiFi SoftAP password: "
|
||||
<< masker::Mask(winrt::to_string(publisher_.Advertisement()
|
||||
.LegacySettings()
|
||||
.Passphrase()
|
||||
.Password()));
|
||||
}
|
||||
return winrt::fire_and_forget();
|
||||
} else if (event.Status() ==
|
||||
|
||||
Reference in New Issue
Block a user