Renamed namespaces

This commit is contained in:
Benjamin Höglinger-Stelzer 2022-09-26 21:00:43 +02:00
parent f9a76b68da
commit 2424f26755
16 changed files with 117 additions and 81 deletions

View File

@ -1,13 +1,41 @@
namespace PInvokeSerialPort
namespace Nefarius.Peripherals.SerialPort;
/// <summary>
/// Byte type with enumeration constants for ASCII control codes.
/// </summary>
public enum ASCII : byte
{
/// <summary>
/// Byte type with enumeration constants for ASCII control codes.
/// </summary>
public enum ASCII : byte
{
NULL = 0x00, SOH = 0x01, STH = 0x02, ETX = 0x03, EOT = 0x04, ENQ = 0x05, ACK = 0x06, BELL = 0x07,
BS = 0x08, HT = 0x09, LF = 0x0A, VT = 0x0B, FF = 0x0C, CR = 0x0D, SO = 0x0E, SI = 0x0F, DC1 = 0x11,
DC2 = 0x12, DC3 = 0x13, DC4 = 0x14, NAK = 0x15, SYN = 0x16, ETB = 0x17, CAN = 0x18, EM = 0x19,
SUB = 0x1A, ESC = 0x1B, FS = 0x1C, GS = 0x1D, RS = 0x1E, US = 0x1F, SP = 0x20, DEL = 0x7F
}
NULL = 0x00,
SOH = 0x01,
STH = 0x02,
ETX = 0x03,
EOT = 0x04,
ENQ = 0x05,
ACK = 0x06,
BELL = 0x07,
BS = 0x08,
HT = 0x09,
LF = 0x0A,
VT = 0x0B,
FF = 0x0C,
CR = 0x0D,
SO = 0x0E,
SI = 0x0F,
DC1 = 0x11,
DC2 = 0x12,
DC3 = 0x13,
DC4 = 0x14,
NAK = 0x15,
SYN = 0x16,
ETB = 0x17,
CAN = 0x18,
EM = 0x19,
SUB = 0x1A,
ESC = 0x1B,
FS = 0x1C,
GS = 0x1D,
RS = 0x1E,
US = 0x1F,
SP = 0x20,
DEL = 0x7F
}

View File

@ -1,22 +1,25 @@
using System;
namespace PInvokeSerialPort
namespace Nefarius.Peripherals.SerialPort;
/// <summary>
/// Exception used for all errors.
/// </summary>
public class CommPortException : ApplicationException
{
/// <summary>
/// Exception used for all errors.
/// </summary>
public class CommPortException : ApplicationException
{
/// <summary>
/// Constructor for raising direct exceptions
/// </summary>
/// <param name="desc">Description of error</param>
public CommPortException(string desc) : base(desc) { }
public CommPortException(string desc) : base(desc)
{
}
/// <summary>
/// Constructor for re-raising exceptions from receive thread
/// </summary>
/// <param name="e">Inner exception raised on receive thread</param>
public CommPortException(Exception e) : base("Receive Thread Exception", e) { }
public CommPortException(Exception e) : base("Receive Thread Exception", e)
{
}
}

View File

@ -1,25 +1,27 @@
namespace PInvokeSerialPort
namespace Nefarius.Peripherals.SerialPort;
/// <summary>
/// Standard handshake methods
/// </summary>
public enum Handshake
{
/// <summary>
/// Standard handshake methods
/// </summary>
public enum Handshake
{
/// <summary>
/// No handshaking
/// </summary>
None,
/// <summary>
/// Software handshaking using Xon / Xoff
/// </summary>
XonXoff,
/// <summary>
/// Hardware handshaking using CTS / RTS
/// </summary>
CtsRts,
/// <summary>
/// Hardware handshaking using DSR / DTR
/// </summary>
DsrDtr
}
}

View File

@ -1,25 +1,27 @@
namespace PInvokeSerialPort
namespace Nefarius.Peripherals.SerialPort;
/// <summary>
/// Uses for RTS or DTR pins
/// </summary>
public enum HsOutput
{
/// <summary>
/// Uses for RTS or DTR pins
/// </summary>
public enum HsOutput
{
/// <summary>
/// Pin is asserted when this station is able to receive data.
/// </summary>
Handshake = 2,
/// <summary>
/// Pin is asserted when this station is transmitting data (RTS on NT, 2000 or XP only).
/// </summary>
Gate = 3,
/// <summary>
/// Pin is asserted when this station is online (port is open).
/// </summary>
Online = 1,
/// <summary>
/// Pin is never asserted.
/// </summary>
None = 0
};
}

View File

@ -1,6 +1,6 @@
using PInvokeSerialPort.Win32PInvoke;
using Nefarius.Peripherals.SerialPort.Win32PInvoke;
namespace PInvokeSerialPort
namespace Nefarius.Peripherals.SerialPort
{
/// <summary>
/// Represents the status of the modem control input signals.

View File

@ -5,7 +5,7 @@
<Authors>Ebrahim Byagowi, Benjamin Höglinger-Stelzer</Authors>
<PackageProjectUrl>https://github.com/nefarius/PInvokeSerialPort</PackageProjectUrl>
<RepositoryUrl>https://github.com/nefarius/PInvokeSerialPort</RepositoryUrl>
<PackageId>Nefarius.PInvokeSerialPort</PackageId>
<PackageId>Nefarius.Peripherals.SerialPort</PackageId>
<Description>P/Invoke wrapper for Win32API serial port</Description>
<Copyright>Copyright 2012-2017 Ebrahim Byagowi, 2018-2022 Benjamin Höglinger-Stelzer</Copyright>
<PackageIconUrl>https://raw.githubusercontent.com/Nefarius/PInvokeSerialPort/master/ProjectIcon.png</PackageIconUrl>
@ -14,6 +14,7 @@
<OutputPath>$(SolutionDir)bin\</OutputPath>
<PackageIcon>NSS-128x128.png</PackageIcon>
<PackageIconUrl />
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>

View File

@ -1,4 +1,4 @@
namespace PInvokeSerialPort
namespace Nefarius.Peripherals.SerialPort
{
/// <summary>
/// Parity settings

View File

@ -1,7 +1,7 @@
using System.Text;
using PInvokeSerialPort.Win32PInvoke;
using Nefarius.Peripherals.SerialPort.Win32PInvoke;
namespace PInvokeSerialPort
namespace Nefarius.Peripherals.SerialPort
{
/// <summary>
/// Represents the current condition of the port queues.

View File

@ -2,9 +2,9 @@
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using PInvokeSerialPort.Win32PInvoke;
using Nefarius.Peripherals.SerialPort.Win32PInvoke;
namespace PInvokeSerialPort
namespace Nefarius.Peripherals.SerialPort
{
/// <summary>
/// PInvokeSerialPort main class.

View File

@ -1,4 +1,4 @@
namespace PInvokeSerialPort
namespace Nefarius.Peripherals.SerialPort
{
/// <summary>
/// Stop bit settings

View File

@ -1,7 +1,7 @@
using System;
using System.Runtime.InteropServices;
namespace PInvokeSerialPort.Win32PInvoke
namespace Nefarius.Peripherals.SerialPort.Win32PInvoke
{
[StructLayout(LayoutKind.Sequential)]
internal struct COMMPROP

View File

@ -1,7 +1,7 @@
using System;
using System.Runtime.InteropServices;
namespace PInvokeSerialPort.Win32PInvoke
namespace Nefarius.Peripherals.SerialPort.Win32PInvoke
{
[StructLayout(LayoutKind.Sequential)]
internal struct COMMTIMEOUTS

View File

@ -1,7 +1,7 @@
using System;
using System.Runtime.InteropServices;
namespace PInvokeSerialPort.Win32PInvoke
namespace Nefarius.Peripherals.SerialPort.Win32PInvoke
{
[StructLayout(LayoutKind.Sequential)]
internal struct COMSTAT

View File

@ -1,7 +1,7 @@
using System;
using System.Runtime.InteropServices;
namespace PInvokeSerialPort.Win32PInvoke
namespace Nefarius.Peripherals.SerialPort.Win32PInvoke
{
[StructLayout(LayoutKind.Sequential)]
internal struct DCB

View File

@ -1,7 +1,7 @@
using System;
using System.Runtime.InteropServices;
namespace PInvokeSerialPort.Win32PInvoke
namespace Nefarius.Peripherals.SerialPort.Win32PInvoke
{
[StructLayout(LayoutKind.Sequential)]
internal struct OVERLAPPED

View File

@ -1,7 +1,7 @@
using System;
using System.Runtime.InteropServices;
namespace PInvokeSerialPort.Win32PInvoke
namespace Nefarius.Peripherals.SerialPort.Win32PInvoke
{
internal class Win32Com
{