Roll forward to cl/314747126

Signed-off-by: Alexey Polyudov <apolyudov@google.com>
Change-Id: Ie19e006429b138b3768e97dae971a43fdc5ef8bf
This commit is contained in:
Alexey Polyudov
2020-06-04 13:50:45 -07:00
parent de31c27947
commit 4baa1ce96a
365 changed files with 28586 additions and 1503 deletions
+40
View File
@@ -136,6 +136,45 @@ class MediumManager {
Ptr<BLESocket> connectToBlePeripheral(Ptr<BLE_PERIPHERAL> ble_peripheral,
const string& service_id);
// ~~~~~~~~~~~~~~~~~~~~~~~~ WIFI-LAN ~~~~~~~~~~~~~~~~~~~~~~~~
bool IsWifiLanAvailable();
bool StartWifiLanAdvertising(absl::string_view service_id,
absl::string_view wifi_lan_service_info_name);
void StopWifiLanAdvertising(absl::string_view service_id);
class FoundWifiLanServiceProcessor {
public:
virtual ~FoundWifiLanServiceProcessor() {}
virtual void OnFoundWifiLanService(
Ptr<WifiLanService> wifi_lan_service) = 0;
virtual void OnLostWifiLanService(Ptr<WifiLanService> wifi_lan_service) = 0;
};
bool StartWifiLanDiscovery(
absl::string_view service_id,
Ptr<FoundWifiLanServiceProcessor> found_wifi_lan_service_processor);
void StopWifiLanDiscovery(absl::string_view service_id);
class IncomingWifiLanConnectionProcessor {
public:
virtual ~IncomingWifiLanConnectionProcessor() {}
virtual void OnIncomingWifiLanConnection(
Ptr<WifiLanSocket> wifi_lan_socket) = 0;
};
bool IsListeningForIncomingWifiLanConnections(absl::string_view service_id);
bool StartListeningForIncomingWifiLanConnections(
absl::string_view service_id, Ptr<IncomingWifiLanConnectionProcessor>
incoming_wifi_lan_connection_processor);
void StopListeningForIncomingWifiLanConnections(absl::string_view service_id);
Ptr<WifiLanSocket> ConnectToWifiLanService(
Ptr<WifiLanService> wifi_lan_service, absl::string_view service_id);
private:
// The destructor for this needs to be manually invoked after the locks below
// are acquired, so it cannot be a ScopedPtr.
@@ -143,6 +182,7 @@ class MediumManager {
ScopedPtr<Ptr<Lock> > bluetooth_classic_lock_;
ScopedPtr<Ptr<Lock> > ble_lock_;
ScopedPtr<Ptr<Lock> > wifi_lan_lock_;
};
} // namespace connections