Merge branch 'master' into release to roll forward to cl/341113126.

This commit is contained in:
hai007
2020-11-06 13:58:02 -08:00
23 changed files with 1216 additions and 79 deletions
+5
View File
@@ -145,5 +145,10 @@ WifiLanService WifiLanMedium::FindRemoteService(const std::string& ip_address,
return WifiLanService(impl_->FindRemoteService(ip_address, port));
}
std::pair<std::string, int> WifiLanMedium::GetServiceAddress(
const std::string& service_id) {
return impl_->GetServiceAddress(service_id);
}
} // namespace nearby
} // namespace location
+5
View File
@@ -106,6 +106,7 @@ class WifiLanSocket final {
class WifiLanMedium final {
public:
using Platform = api::ImplementationPlatform;
struct DiscoveredServiceCallback {
std::function<void(WifiLanService& wifi_lan_service,
const std::string& service_id)>
@@ -116,6 +117,7 @@ class WifiLanMedium final {
service_lost_cb =
DefaultCallback<WifiLanService&, const std::string&>();
};
struct ServiceDiscoveryInfo {
WifiLanService service;
};
@@ -124,6 +126,7 @@ class WifiLanMedium final {
std::function<void(WifiLanSocket socket, const std::string& service_id)>
accepted_cb = DefaultCallback<WifiLanSocket, const std::string&>();
};
struct AcceptedConnectionInfo {
WifiLanSocket socket;
};
@@ -161,6 +164,8 @@ class WifiLanMedium final {
WifiLanService FindRemoteService(const std::string& ip_address, int port);
std::pair<std::string, int> GetServiceAddress(const std::string& service_id);
private:
Mutex mutex_;
std::unique_ptr<api::WifiLanMedium> impl_;