private void ConnectClicked() { // connect var version = 0; DeviceModel.USBConnect(ref version); if (!DeviceModel.DeviceDetected) { return; } OnPropertyChanged("IsConnected"); OnConnected(version); // read settings var settingsData = DeviceModel.ReadSettings(); if (settingsData != null) { ConvertSettings(settingsData); } // then queue call to read bulk data DeviceModel.ReadBulkData(); }
private void DeviceModelOnBulkDataArrived(object sender, BulkDataArrivedArgs bulkDataArrivedArgs) { // have some data // copy it over and check if oneshot flag is not set // if not, then requeue another call ScopeData = new ObservableCollection <byte>(bulkDataArrivedArgs.Data); DeviceModel.ReadBulkData(); }
public void Connect() { var version = 0; DeviceModel.USBConnect(ref version); if (!DeviceModel.DeviceDetected) { return; } OnPropertyChanged("IsConnected"); var stopCommand = _stopCommand as RoutableCommand; if (stopCommand != null) { stopCommand.RaiseCanExecuteChanged(); } var autoCommand = _autoCommand as RoutableCommand; if (autoCommand != null) { autoCommand.RaiseCanExecuteChanged(); } var connectCommand = _connectCommand as RoutableCommand; if (connectCommand != null) { connectCommand.RaiseCanExecuteChanged(); } // then queue call to read bulk data DeviceModel.ReadBulkData(); }