diff --git a/.gitignore b/.gitignore index af5c6a9..113e3ad 100755 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ _ReSharper*/ /.tmp *.DotSettings /misc +/.idea diff --git a/Nefarius.Peripherals.SerialPort/SerialPort.cs b/Nefarius.Peripherals.SerialPort/SerialPort.cs index 16ae533..04f018f 100644 --- a/Nefarius.Peripherals.SerialPort/SerialPort.cs +++ b/Nefarius.Peripherals.SerialPort/SerialPort.cs @@ -317,11 +317,9 @@ public partial class SerialPort : IDisposable /// Modem status object protected ModemStatus GetModemStatus() { - uint f; - CheckOnline(); - if (!Win32Com.GetCommModemStatus(_hPort.DangerousGetHandle(), out f)) ThrowException("Unexpected failure"); - return new ModemStatus(f); + if (!Win32Com.GetCommModemStatus(_hPort.DangerousGetHandle(), out var f)) ThrowException("Unexpected failure"); + return new ModemStatus((MODEM_STATUS_FLAGS)f); } /// @@ -497,7 +495,7 @@ public partial class SerialPort : IDisposable uint f; if (!Win32Com.GetCommModemStatus(_hPort.DangerousGetHandle(), out f)) throw new CommPortException("IO Error [005]"); - OnStatusChange(new ModemStatus(i), new ModemStatus(f)); + OnStatusChange(new ModemStatus((MODEM_STATUS_FLAGS)i), new ModemStatus((MODEM_STATUS_FLAGS)f)); } } }