private async void Stop_OnClick(object sender, RoutedEventArgs e) { await PopupIfThrowsAsync(async() => { if (_serial == null) { throw new InvalidOperationException("Not connected"); } await _serial.SendCommandAsync(BciCommand.Simple(BciCommand.General.STOP_STREAM)); txtInfo.Text += "Streaming stopped\n"; DataManager.Current.Stop(); }); }
private async void Reset_OnClick(object sender, RoutedEventArgs e) { await PopupIfThrowsAsync(async() => { if (_serial == null) { throw new InvalidOperationException("Not connected"); } await _serial.SendCommandAsync(BciCommand.Simple(BciCommand.General.RESET)); txtInfo.Text += "Device reset\n"; txtInfo.Text = ""; DataManager.Current.Stop(); }); }