in src/Covi.Android/Features/Bluetooth/BtScanner.cs [183:203]
public override void OnConnectionStateChange(BluetoothGatt gatt, GattStatus status, ProfileState newState)
{
base.OnConnectionStateChange(gatt, status, newState);
System.Threading.Tasks.Task.Run(() =>
{
if (newState == ProfileState.Connected)
{
if (gatt != null)
{
_deviceManager.HandleDeviceConnected(_descriptor, (d) =>
{
gatt.DiscoverServices();
});
}
}
else if (newState == ProfileState.Disconnected)
{
_deviceManager.HandleDeviceDisconnected(_descriptor);
}
}).FireAndForget();
}