提交 a1a24c16 编写于 作者: M Marcus Fehde

Cleanup acc. to review remarks

上级 834c8864
......@@ -168,11 +168,6 @@ namespace Iot.Device.Ahtxx
/// <inheritdoc cref="IDisposable" />
protected virtual void Dispose(bool disposing)
{
if (_i2cDevice == null)
{
return;
}
_i2cDevice?.Dispose();
_i2cDevice = null;
}
......
......@@ -66,10 +66,12 @@ namespace Iot.Device.Mhz19b
}
// create serial port using the setting acc. to datasheet, pg. 7, sec. general settings
_serialPort = new SerialPort(uartDevice, 9600, Parity.None, 8, StopBits.One);
_serialPort.Encoding = Encoding.ASCII;
_serialPort.ReadTimeout = 1000;
_serialPort.WriteTimeout = 1000;
_serialPort = new SerialPort(uartDevice, 9600, Parity.None, 8, StopBits.One)
{
Encoding = Encoding.ASCII,
ReadTimeout = 1000,
WriteTimeout = 1000
};
_serialPort.Open();
_serialPortStream = _serialPort.BaseStream;
_shouldDispose = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册