Added connect retry for Bluetooth

PiperOrigin-RevId: 522382120
This commit is contained in:
Guogang Li
2023-04-06 11:04:59 -07:00
committed by Copybara-Service
parent d65c4cea82
commit 097ff07811
2 changed files with 90 additions and 59 deletions
@@ -131,6 +131,9 @@ class BluetoothSocket : public api::BluetoothSocket {
Buffer write_buffer_{kMaxTransmitPacketSize};
};
bool InternalConnect(HostName connectionHostName,
winrt::hstring connectionServiceName);
winrt::fire_and_forget Listener_ConnectionStatusChanged(
winrt::Windows::Devices::Bluetooth::BluetoothDevice device,
winrt::Windows::Foundation::IInspectable const& args);
@@ -143,6 +146,7 @@ class BluetoothSocket : public api::BluetoothSocket {
winrt::Windows::Devices::Bluetooth::BluetoothDevice native_bluetooth_device_{
nullptr};
winrt::event_token connection_status_changed_token_{};
int connect_called_count_ = 0;
};
} // namespace windows