More type migrations
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
using Nefarius.Peripherals.SerialPort.Win32PInvoke;
|
||||
using Windows.Win32;
|
||||
using Windows.Win32.Devices.Communication;
|
||||
|
||||
using Nefarius.Peripherals.SerialPort.Win32PInvoke;
|
||||
|
||||
namespace Nefarius.Peripherals.SerialPort;
|
||||
|
||||
@@ -141,14 +144,14 @@ public partial class SerialPort
|
||||
CheckOnline();
|
||||
if (value)
|
||||
{
|
||||
if (Win32Com.EscapeCommFunction(_hPort.DangerousGetHandle(), Win32Com.SETRTS))
|
||||
if (PInvoke.EscapeCommFunction(_hPort, ESCAPE_COMM_FUNCTION.SETRTS))
|
||||
_stateRts = 1;
|
||||
else
|
||||
ThrowException("Unexpected Failure");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Win32Com.EscapeCommFunction(_hPort.DangerousGetHandle(), Win32Com.CLRRTS))
|
||||
if (PInvoke.EscapeCommFunction(_hPort, ESCAPE_COMM_FUNCTION.CLRRTS))
|
||||
_stateRts = 1;
|
||||
else
|
||||
ThrowException("Unexpected Failure");
|
||||
@@ -173,14 +176,14 @@ public partial class SerialPort
|
||||
CheckOnline();
|
||||
if (value)
|
||||
{
|
||||
if (Win32Com.EscapeCommFunction(_hPort.DangerousGetHandle(), Win32Com.SETDTR))
|
||||
if (PInvoke.EscapeCommFunction(_hPort, ESCAPE_COMM_FUNCTION.SETDTR))
|
||||
_stateDtr = 1;
|
||||
else
|
||||
ThrowException("Unexpected Failure");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Win32Com.EscapeCommFunction(_hPort.DangerousGetHandle(), Win32Com.CLRDTR))
|
||||
if (PInvoke.EscapeCommFunction(_hPort, ESCAPE_COMM_FUNCTION.CLRDTR))
|
||||
_stateDtr = 0;
|
||||
else
|
||||
ThrowException("Unexpected Failure");
|
||||
@@ -200,14 +203,14 @@ public partial class SerialPort
|
||||
CheckOnline();
|
||||
if (value)
|
||||
{
|
||||
if (Win32Com.EscapeCommFunction(_hPort.DangerousGetHandle(), Win32Com.SETBREAK))
|
||||
if (PInvoke.EscapeCommFunction(_hPort, ESCAPE_COMM_FUNCTION.SETBREAK))
|
||||
_stateBrk = 0;
|
||||
else
|
||||
ThrowException("Unexpected Failure");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Win32Com.EscapeCommFunction(_hPort.DangerousGetHandle(), Win32Com.CLRBREAK))
|
||||
if (PInvoke.EscapeCommFunction(_hPort, ESCAPE_COMM_FUNCTION.CLRBREAK))
|
||||
_stateBrk = 0;
|
||||
else
|
||||
ThrowException("Unexpected Failure");
|
||||
|
||||
Reference in New Issue
Block a user