-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Description
Hi All,
I tried to set a new baudrate with SetPort() methode, but it doesn't work.
Indeed, SetPort() test if a change occured for portName only, but not the other parameters.
I suggest the following changes
public void SetPort(string portName, int baudRate = 115200, StopBits stopBits = StopBits.One, Parity parity = Parity.None, DataBits dataBits = DataBits.Eight)
{
if (_portName != portName || _baudRate != baudRate || stopBits != _stopBits || parity != _parity || dataBits != _dataBits)
{
// set to error so that the connection watcher will reconnect
// using the new port
gotReadWriteError = true;
logger.Trace("Port parameter changed (port name / baudrate / stopbits / parity / databits) = " + portName + " / " + baudRate + " / " + stopBits + " / " + parity + " / " + dataBits);
}
_portName = portName;
_baudRate = baudRate;
_stopBits = stopBits;
_parity = parity;
_dataBits = dataBits;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels