示例#1
0
        private void SetupBus()
        {
            if (_bus != null)
            {
                Disconnect();
                _bus.PropertyChanged  -= BusPropertyChanged;
                _bus.DeviceUpdate     -= BusDeviceUpdated;
                _bus.ResponseReceived -= BusResponseReceived;
            }

            if (_comPort != null && _comPort.Length > 0)
            {
                switch (_type)
                {
                case EosBusType.BusMaster:
                    _bus = new EosBusMaster(_comPort, 250000);
                    break;

                case EosBusType.BusInterface:
                    _bus = new EosBusInterfaceSerial(_comPort, 250000);
                    break;
                }

                IsScanning             = true;
                _bus.PropertyChanged  += BusPropertyChanged;
                _bus.DeviceUpdate     += BusDeviceUpdated;
                _bus.ResponseReceived += BusResponseReceived;
            }
        }
示例#2
0
        private void SetupBus()
        {
            if (_bus != null)
            {
                Disconnect();
                _bus.PropertyChanged -= BusPropertyChanged;
                _bus.DeviceUpdate -= BusDeviceUpdated;
                _bus.ResponseReceived -= BusResponseReceived;
            }

            if (_comPort != null && _comPort.Length > 0)
            {
                switch (_type)
                {
                    case EosBusType.BusMaster:
                        _bus = new EosBusMaster(_comPort, 250000);
                        break;
                    case EosBusType.BusInterface:
                        _bus = new EosBusInterfaceSerial(_comPort, 250000);
                        break;
                }

                IsScanning = true;
                _bus.PropertyChanged += BusPropertyChanged;
                _bus.DeviceUpdate += BusDeviceUpdated;
                _bus.ResponseReceived += BusResponseReceived;
            }
        }