コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }