public void SetUp()
		{
			_serialParameters = new SerialParameters();
			_serialParameters.PortName = "COM3";

			_serialConnection = new SerialConnection(_serialParameters);

			//TODO what I really want to do above is have a config file w/ test settings which will vary by developement environment
			// e.g. SerialParameters sp = new SerialParameters(props.TestPortName, props.TestBaudRate, ...
		}
Example #2
0
        public void SetUp()
        {
            _serialParameters          = new SerialParameters();
            _serialParameters.PortName = "COM3";

            _serialConnection = new SerialConnection(_serialParameters);

            //TODO what I really want to do above is have a config file w/ test settings which will vary by developement environment
            // e.g. SerialParameters sp = new SerialParameters(props.TestPortName, props.TestBaudRate, ...
        }
        public WinRTSerialDevice(SerialDeviceName accessPoint, WindowsSerialDevice device, SerialParameters parameters)
        {
            Local      = accessPoint;
            Port       = device;
            Parameters = parameters;
            Parameters.PropertyChanged += Parameters_PropertyChanged;

            Port.BaudRate         = Parameters.BaudRate;
            Port.BreakSignalState = Parameters.BreakSignalState;
            Port.DataBits         = Parameters.DataBits;
            //Port.Handshake = Parameters.Handshake;
            Port.IsDataTerminalReadyEnabled = Parameters.IsDataTerminalReadyEnabled;
            Port.IsRequestToSendEnabled     = Parameters.IsRequestToSendEnabled;
            //Port.Parity = Parameters.Parity;
            Port.ReadTimeout = Parameters.ReadTimeout ?? TimeSpan.Zero;
            //Port.StopBits = Parameters.StopBits;
            Port.WriteTimeout = Parameters.WriteTimeout ?? TimeSpan.Zero;
        }
        public Win32SerialDevice(SerialDeviceName accessPoint, SerialPort device, SerialParameters parameters)
        {
            Local      = accessPoint;
            Port       = device;
            Parameters = parameters;
            Parameters.PropertyChanged += Parameters_PropertyChanged;

            Port.BaudRate = (int)Parameters.BaudRate;
            //Port.BreakSignalState = Parameters.BreakSignalState;
            Port.DataBits = Parameters.DataBits;
            //Port.Handshake = Parameters.Handshake;
            Port.DtrEnable = Parameters.IsDataTerminalReadyEnabled;
            Port.RtsEnable = Parameters.IsRequestToSendEnabled;
            //Port.Parity = Parameters.Parity;
            Port.ReadBufferSize = (int)Parameters.ReadBufferSize;
            Port.ReadTimeout    = (int)(Parameters.ReadTimeout?.TotalMilliseconds ?? -1);
            //Port.StopBits = Parameters.StopBits;
            Port.WriteBufferSize = (int)Parameters.WriteBufferSize;
            Port.WriteTimeout    = (int)(Parameters.WriteTimeout?.TotalMilliseconds ?? -1);
        }