예제 #1
0
        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);
                }
            }
        }
예제 #2
0
        public async Task DisconnectDriver()
        {
            await _driver.Disconnect();

            MessagingCenter.Send($"Device {_driver.Configuration.DeviceName} disconnected", BaseViewModel.MSG_ToastMessage);

            UpdateDriverState();
        }
예제 #3
0
        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);
                }
            }
        }