mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
Remove unused field from HotspotCredentials.
PiperOrigin-RevId: 823606909
This commit is contained in:
committed by
Copybara-Service
parent
9ccfded727
commit
e99faba5fc
@@ -135,7 +135,6 @@ HotspotCredentials* WifiHotspot::GetCredentials(absl::string_view service_id) {
|
||||
return crendential;
|
||||
}
|
||||
crendential->SetGateway(it->second.GetIPAddress());
|
||||
crendential->SetIPAddress(it->second.GetIPAddress());
|
||||
crendential->SetPort(it->second.GetPort());
|
||||
|
||||
return crendential;
|
||||
|
||||
@@ -1045,7 +1045,7 @@ api::WifiHotspotMedium* MediumEnvironment::GetWifiHotspotMedium(
|
||||
if (info.is_ap && info.hotspot_credentials) {
|
||||
if ((info.hotspot_credentials->GetSSID() == ssid) ||
|
||||
(!ip_address.empty() &&
|
||||
(info.hotspot_credentials->GetIPAddress() == ip_address))) {
|
||||
(info.hotspot_credentials->GetGateway() == ip_address))) {
|
||||
LOG(INFO) << "Found Remote WifiHotspot medium=" << medium_found;
|
||||
return medium_found;
|
||||
}
|
||||
|
||||
@@ -43,12 +43,8 @@ class HotspotCredentials {
|
||||
std::string GetPassword() const { return password_; }
|
||||
void SetPassword(const std::string& password) { password_ = password; }
|
||||
|
||||
// Gets IP Address, which is in byte sequence, in network order. For example,
|
||||
// for "192.168.1.1", it'll be byte(129)+byte(168)+byte(1)+byte(1). Now only
|
||||
// ipv4 is supported.
|
||||
std::string GetIPAddress() const { return ip_address_; }
|
||||
void SetIPAddress(const std::string& ip_address) { ip_address_ = ip_address; }
|
||||
|
||||
// Gets IP Address in string format.
|
||||
// This is the IP address at which the service is provided.
|
||||
std::string GetGateway() const { return gateway_; }
|
||||
void SetGateway(const std::string& gateway) { gateway_ = gateway; }
|
||||
|
||||
@@ -76,8 +72,7 @@ class HotspotCredentials {
|
||||
private:
|
||||
std::string ssid_;
|
||||
std::string password_;
|
||||
std::string ip_address_;
|
||||
std::string gateway_ = "0.0.0.0";
|
||||
std::string gateway_;
|
||||
int port_ = 0;
|
||||
int frequency_ = -1;
|
||||
location::nearby::proto::connections::ConnectionBand band_;
|
||||
|
||||
@@ -140,7 +140,7 @@ TEST_P(WifiHotspotMediumTest, CanStartHotspotThatOtherConnect) {
|
||||
|
||||
WifiHotspotServerSocket server_socket = wifi_hotspot_a->ListenForService();
|
||||
EXPECT_TRUE(server_socket.IsValid());
|
||||
wifi_hotspot_a->GetCredential()->SetIPAddress(server_socket.GetIPAddress());
|
||||
wifi_hotspot_a->GetCredential()->SetGateway(server_socket.GetIPAddress());
|
||||
|
||||
WifiHotspotSocket socket_a;
|
||||
WifiHotspotSocket socket_b;
|
||||
@@ -205,7 +205,7 @@ TEST_P(WifiHotspotMediumTest, CanStartHotspotThatOtherCanCancelConnect) {
|
||||
|
||||
WifiHotspotServerSocket server_socket = wifi_hotspot_a->ListenForService();
|
||||
EXPECT_TRUE(server_socket.IsValid());
|
||||
wifi_hotspot_a->GetCredential()->SetIPAddress(server_socket.GetIPAddress());
|
||||
wifi_hotspot_a->GetCredential()->SetGateway(server_socket.GetIPAddress());
|
||||
|
||||
WifiHotspotSocket socket_a;
|
||||
WifiHotspotSocket socket_b;
|
||||
|
||||
Reference in New Issue
Block a user