This commit is contained in:
2022-09-26 23:51:23 +02:00
parent 5b8daef830
commit 54ed60d9f8
4 changed files with 608 additions and 684 deletions
@@ -7,9 +7,9 @@ namespace Nefarius.Peripherals.SerialPort;
/// </summary>
public readonly struct ModemStatus
{
private readonly uint _status;
private readonly MODEM_STATUS_FLAGS _status;
internal ModemStatus(uint val)
internal ModemStatus(MODEM_STATUS_FLAGS val)
{
_status = val;
}
@@ -17,20 +17,20 @@ public readonly struct ModemStatus
/// <summary>
/// Condition of the Clear To Send signal.
/// </summary>
public bool Cts => (_status & (uint)MODEM_STATUS_FLAGS.MS_CTS_ON) != 0;
public bool Cts => (_status & MODEM_STATUS_FLAGS.MS_CTS_ON) != 0;
/// <summary>
/// Condition of the Data Set Ready signal.
/// </summary>
public bool Dsr => (_status & (uint)MODEM_STATUS_FLAGS.MS_DSR_ON) != 0;
public bool Dsr => (_status & MODEM_STATUS_FLAGS.MS_DSR_ON) != 0;
/// <summary>
/// Condition of the Receive Line Status Detection signal.
/// </summary>
public bool Rlsd => (_status & (uint)MODEM_STATUS_FLAGS.MS_RLSD_ON) != 0;
public bool Rlsd => (_status & MODEM_STATUS_FLAGS.MS_RLSD_ON) != 0;
/// <summary>
/// Condition of the Ring Detection signal.
/// </summary>
public bool Ring => (_status & (uint)MODEM_STATUS_FLAGS.MS_RING_ON) != 0;
public bool Ring => (_status & MODEM_STATUS_FLAGS.MS_RING_ON) != 0;
}