public void DisconnectDevice(IDevice device)
{
if (_gatt == null)
return;
Action action = () => PerformDisconnect(device);
if (Configuration.DisconnectOnMainThread)
{
var handler = new Handler(Looper.MainLooper);
handler.PostAtFrontOfQueue(action);
}
else
{
action.Invoke();
}
}