public PuttySerialConfiguration(uint baud, byte dataBits, float stopBits, PuttySerialParity parity, PuttySerialFlowControl flowControl) { if (!ValidateDataBits(dataBits)) { throw new ArgumentOutOfRangeException(nameof(dataBits), dataBits, Localization.strings.Exception_Serial_DataBits_OutOfRange); } if (!ValidateStopBits(stopBits)) { throw new ArgumentOutOfRangeException(nameof(stopBits), stopBits, Localization.strings.Exception_Serial_StopBits_OutOfRange); } this.BaudRate = baud; this.DataBits = dataBits; this.StopBits = stopBits; this.Parity = parity; this.FlowControl = flowControl; }
public static string GetFlowControl(this PuttySerialFlowControl flowControl) { switch (flowControl) { case PuttySerialFlowControl.None: return("N"); case PuttySerialFlowControl.XON_XOFF: return("X"); case PuttySerialFlowControl.RTS_CTS: return("R"); case PuttySerialFlowControl.DSR_DTR: return("D"); } return(string.Empty); }