private void PerformDisconnect(IDevice device)
{
try
{
_gatt.Close(); // this will not trigger the OnConnectionStateChange.OnConnectionStateChange callback
_gatt = null;
DeviceDisconnected(this, new DeviceConnectionEventArgs(device));
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine(e.Message);
}
}
}