We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f72fa9c commit bfe177bCopy full SHA for bfe177b
nanoFramework.Logging.Serial/SerialLoggerFactory.cs
@@ -49,12 +49,15 @@ public SerialLoggerFactory(
49
/// <inheritdoc/>
50
public ILogger CreateLogger(string categoryName)
51
{
52
- _serial = new SerialPort(_comPort);
53
- _serial.BaudRate = _baudRate;
54
- _serial.Parity = _parity;
55
- _serial.StopBits = _stopBits;
56
- _serial.Handshake = _handshake;
57
- _serial.DataBits = _dataBits;
+ if (_serial is null)
+ {
+ _serial = new SerialPort(_comPort);
+ _serial.BaudRate = _baudRate;
+ _serial.Parity = _parity;
+ _serial.StopBits = _stopBits;
58
+ _serial.Handshake = _handshake;
59
+ _serial.DataBits = _dataBits;
60
+ }
61
return new SerialLogger(ref _serial, categoryName);
62
}
63
0 commit comments