public DataCollection(SerialPortSettings settings) { DirectoryName = "RawData"; FileName = ""; SerialPortSettings = settings; DataReceivedHandler = dataReceivedHandler; }
/// <summary> /// Initialize serial port with settings /// </summary> /// <param name="settings"></param> /// <returns>Initialized serial port</returns> SerialPort initializeSerialPort(SerialPortSettings settings) { var tmpSerialPort = new SerialPort(settings.SerialPort); tmpSerialPort.BaudRate = settings.BaudRate; tmpSerialPort.Parity = settings.Parity; tmpSerialPort.StopBits = settings.StopBits; tmpSerialPort.DataBits = settings.DataBits; tmpSerialPort.Handshake = settings.Handshake; tmpSerialPort.RtsEnable = settings.RtsEnable; return(tmpSerialPort); }