mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
WifiLan::Change GetUpgradeAddressCandidates to use ServiceAddress.
PiperOrigin-RevId: 842257461
This commit is contained in:
committed by
Copybara-Service
parent
8e597c9df0
commit
4652aef48c
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "internal/platform/implementation/g3/wifi_lan.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
@@ -28,6 +29,7 @@
|
||||
#include "internal/platform/logging.h"
|
||||
#include "internal/platform/medium_environment.h"
|
||||
#include "internal/platform/nsd_service_info.h"
|
||||
#include "internal/platform/wifi_credential.h"
|
||||
|
||||
namespace nearby {
|
||||
namespace g3 {
|
||||
@@ -282,9 +284,12 @@ std::unique_ptr<api::WifiLanServerSocket> WifiLanMedium::ListenForService(
|
||||
return server_socket;
|
||||
}
|
||||
|
||||
std::vector<std::string> WifiLanMedium::GetUpgradeAddressCandidates(
|
||||
std::vector<ServiceAddress> WifiLanMedium::GetUpgradeAddressCandidates(
|
||||
const api::WifiLanServerSocket& server_socket) {
|
||||
return { server_socket.GetIPAddress() };
|
||||
std::string ip_address = server_socket.GetIPAddress();
|
||||
return {ServiceAddress{
|
||||
.address = std::vector<char>(ip_address.begin(), ip_address.end()),
|
||||
.port = static_cast<uint16_t>(server_socket.GetPort())}};
|
||||
}
|
||||
|
||||
} // namespace g3
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "internal/platform/medium_environment.h"
|
||||
#include "internal/platform/nsd_service_info.h"
|
||||
#include "internal/platform/output_stream.h"
|
||||
#include "internal/platform/wifi_credential.h"
|
||||
|
||||
namespace nearby {
|
||||
namespace g3 {
|
||||
@@ -207,7 +208,7 @@ class WifiLanMedium : public api::WifiLanMedium {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::vector<std::string> GetUpgradeAddressCandidates(
|
||||
std::vector<ServiceAddress> GetUpgradeAddressCandidates(
|
||||
const api::WifiLanServerSocket& server_socket) override;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user