mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 07:36:10 -04:00
Merge branch 'master' into release
Change-Id: Ieb7f2b392864096e9cd783ab89f32442bc57abe7
This commit is contained in:
@@ -22,8 +22,8 @@ namespace nearby {
|
||||
|
||||
bool WifiLanMedium::StartAdvertising(
|
||||
const std::string& service_id,
|
||||
const std::string& wifi_lan_service_info_name) {
|
||||
return impl_->StartAdvertising(service_id, wifi_lan_service_info_name);
|
||||
const std::string& service_info_name) {
|
||||
return impl_->StartAdvertising(service_id, service_info_name);
|
||||
}
|
||||
|
||||
bool WifiLanMedium::StopAdvertising(const std::string& service_id) {
|
||||
@@ -48,13 +48,18 @@ bool WifiLanMedium::StartDiscovery(const std::string& service_id,
|
||||
&service, absl::make_unique<ServiceDiscoveryInfo>());
|
||||
auto& context = *pair.first->second;
|
||||
if (!pair.second) {
|
||||
NEARBY_LOG(INFO, "Adding (again) service=%p, impl=%p",
|
||||
&context.service, &service);
|
||||
NEARBY_LOG(INFO,
|
||||
"Discovering (again) service=%p, impl=%p, "
|
||||
"service_info_name=%s",
|
||||
&context.service, &service,
|
||||
service.GetName().c_str());
|
||||
return;
|
||||
}
|
||||
context.service = WifiLanService(&service);
|
||||
NEARBY_LOG(INFO, "Adding service=%p, impl=%p", &context.service,
|
||||
&service);
|
||||
NEARBY_LOG(
|
||||
INFO,
|
||||
"Discovering service=%p, impl=%p, service_info_name=%s",
|
||||
&context.service, &service, service.GetName().c_str());
|
||||
discovered_service_callback_.service_discovered_cb(
|
||||
context.service, service_id);
|
||||
},
|
||||
@@ -100,12 +105,13 @@ bool WifiLanMedium::StartAcceptingConnections(
|
||||
&socket, absl::make_unique<AcceptedConnectionInfo>());
|
||||
auto& context = *pair.first->second;
|
||||
if (!pair.second) {
|
||||
NEARBY_LOG(INFO, "Adding (again) socket=%p, impl=%p",
|
||||
NEARBY_LOG(INFO, "Accepting (again) socket=%p, impl=%p",
|
||||
&context.socket, &socket);
|
||||
context.socket = WifiLanSocket(&socket);
|
||||
} else {
|
||||
NEARBY_LOG(INFO, "Accepting socket=%p, impl=%p",
|
||||
&context.socket, &socket);
|
||||
}
|
||||
NEARBY_LOG(INFO, "Adding socket=%p, impl=%p", &context.socket,
|
||||
&socket);
|
||||
accepted_connection_callback_.accepted_cb(context.socket,
|
||||
service_id);
|
||||
},
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
namespace location {
|
||||
namespace nearby {
|
||||
|
||||
// Opaque wrapper over a WifiLan service which contains encoded service name.
|
||||
// Opaque wrapper over a WifiLan service which contains packed
|
||||
// |WifiLanServiceInfo| string name.
|
||||
class WifiLanService final {
|
||||
public:
|
||||
WifiLanService() = default;
|
||||
@@ -127,7 +128,7 @@ class WifiLanMedium final {
|
||||
~WifiLanMedium() = default;
|
||||
|
||||
bool StartAdvertising(const std::string& service_id,
|
||||
const std::string& wifi_lan_service_info_name);
|
||||
const std::string& service_info_name);
|
||||
bool StopAdvertising(const std::string& service_id);
|
||||
|
||||
// Returns true once the WifiLan discovery has been initiated.
|
||||
|
||||
Reference in New Issue
Block a user