public MainWindowViewModel()
        {
            clearSend();
            clearRecieve();

            Device = new HidDeviceViewModel();
            var communicationProtocol = new CommunicationProtocol(new Coder(CoderSatateSize.Size4), new Hash(), new Coder(CoderSatateSize.Size4), new Hash());
            HidDeviceCommunicationProtocol = new HidDeviceCommunicationProtocol(Device, communicationProtocol);
            HidDeviceCommunicationProtocol.ReceiveText += receiveText;

            _updateReceiveText = new Timer
            {
                AutoReset = true,
                Interval = UpdateReceiveTextInterval
            };
            _updateReceiveText.Elapsed += updateReceiveTextOnElapsed;

            ClearRecieve = new CommandAllowExecute(_ => clearRecieve());
            ClearSend = new CommandAllowExecute(_ => clearSend());
            Send = new CommandAllowExecute(_ => send());
            UpdateDeviceStatus = new CommandAllowExecute(_ => updateDeviceStatus());
            GenerateValidationKey = new CommandAllowExecute(_ => generateValidationKey());
        }
Beispiel #2
0
        public MainWindowViewModel()
        {
            clearSend();
            clearRecieve();

            Device = new HidDeviceViewModel();
            var communicationProtocol = new CommunicationProtocol(new Coder(CoderSatateSize.Size4), new Hash(), new Coder(CoderSatateSize.Size4), new Hash());

            HidDeviceCommunicationProtocol              = new HidDeviceCommunicationProtocol(Device, communicationProtocol);
            HidDeviceCommunicationProtocol.ReceiveText += receiveText;

            _updateReceiveText = new Timer
            {
                AutoReset = true,
                Interval  = UpdateReceiveTextInterval
            };
            _updateReceiveText.Elapsed += updateReceiveTextOnElapsed;

            ClearRecieve          = new CommandAllowExecute(_ => clearRecieve());
            ClearSend             = new CommandAllowExecute(_ => clearSend());
            Send                  = new CommandAllowExecute(_ => send());
            UpdateDeviceStatus    = new CommandAllowExecute(_ => updateDeviceStatus());
            GenerateValidationKey = new CommandAllowExecute(_ => generateValidationKey());
        }
Beispiel #3
0
 public HidDeviceCommunicationProtocol(HidDeviceViewModel device, ICommunicationProtocol communicationProtocol)
 {
     CommunicationProtocol = communicationProtocol;
     _device = device;
     _device.ReceiveBytes += hidDeviceOnReceiveBytes;
 }
 public HidDeviceCommunicationProtocol(HidDeviceViewModel device, ICommunicationProtocol communicationProtocol)
 {
     CommunicationProtocol = communicationProtocol;
     _device = device;
     _device.ReceiveBytes += hidDeviceOnReceiveBytes;
 }