protected override async void OnResume() { _loggingService.Info($"OnResume"); if (_config.PlayOnBackground) { _mainPage.ResumePlayback(); } if (!_driver.Started) { MessagingCenter.Send("", BaseViewModel.MSG_Init); } else { var status = await _driver.CheckStatus(); if (!status) { await _driver.Disconnect(); MessagingCenter.Send("connection failed", BaseViewModel.MSG_DVBTDriverConfigurationFailed); } } }
public async Task DisconnectDriver() { await _driver.Disconnect(); MessagingCenter.Send($"Device {_driver.Configuration.DeviceName} disconnected", BaseViewModel.MSG_ToastMessage); UpdateDriverState(); }
private async void CheckIfUsbAttachedOrDetached(object sender, EventArgs e) { // TODO: detect device that has been attached if (!_driverManager.Started) { InitDriver(); } else { var status = await _driverManager.CheckStatus(); if (!status) { await _driverManager.Disconnect(); MessagingCenter.Send("connection failed", BaseViewModel.MSG_DVBTDriverConfigurationFailed); } } }