public DeviceConnection(DeviceNode deviceNode, IFTDevice device) { DeviceNode = deviceNode; this.device = device; State = ConnectionState.Initializing; ReadBuffer = new byte[] { }; WriteASCIICommand = new DelegateCommand <string>(OnWriteASCII, _ => State == ConnectionState.Ready); WriteBytesCommand = new DelegateCommand <string>(OnWriteBytes, _ => State == ConnectionState.Ready); }
public DeviceConnection(DeviceNode deviceNode, IFTDevice device) { DeviceNode = deviceNode; this.device = device; State = ConnectionState.Initializing; ReadBuffer = new byte[] { }; WriteASCIICommand = new DelegateCommand<string>(OnWriteASCII, _ => State == ConnectionState.Ready); WriteBytesCommand = new DelegateCommand<string>(OnWriteBytes, _ => State == ConnectionState.Ready); }
private async void OnSelectDevice(DeviceNode deviceNode) { DeviceConnection newConnection; lock (locker) // make sure we don't create multiple device connections by a trigger happy user { if (DeviceConnection != null) return; var device = ftManager.OpenByDeviceID(deviceNode.DeviceId); newConnection = new DeviceConnection(deviceNode, device); DeviceConnection = newConnection; } var defaultSettings = DeviceConnection.DefaultSettings; await newConnection.InitializeSettings(defaultSettings); }
private async void OnSelectDevice(DeviceNode deviceNode) { DeviceConnection newConnection; lock (locker) // make sure we don't create multiple device connections by a trigger happy user { if (DeviceConnection != null) { return; } var device = ftManager.OpenByDeviceID(deviceNode.DeviceId); newConnection = new DeviceConnection(deviceNode, device); DeviceConnection = newConnection; } var defaultSettings = DeviceConnection.DefaultSettings; await newConnection.InitializeSettings(defaultSettings); }