2024-01-29 15:37:19 +01:00
|
|
|
|
namespace CShocker.Devices.Abstract;
|
|
|
|
|
|
2024-02-12 02:01:31 +01:00
|
|
|
|
public readonly struct SerialPortInfo
|
2024-01-29 15:37:19 +01:00
|
|
|
|
{
|
2024-02-12 02:01:31 +01:00
|
|
|
|
// ReSharper disable thrice MemberCanBePrivate.Global -> Exposed
|
2024-01-29 15:37:19 +01:00
|
|
|
|
public readonly string? PortName, Description, Manufacturer, DeviceID;
|
|
|
|
|
|
|
|
|
|
public SerialPortInfo(string? portName, string? description, string? manufacturer, string? deviceID)
|
|
|
|
|
{
|
|
|
|
|
this.PortName = portName;
|
|
|
|
|
this.Description = description;
|
|
|
|
|
this.Manufacturer = manufacturer;
|
|
|
|
|
this.DeviceID = deviceID;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
2024-02-12 02:04:09 +01:00
|
|
|
|
return $"{string.Join("\n\t",
|
|
|
|
|
$"{GetType().Name}",
|
|
|
|
|
$"PortName: {PortName}",
|
|
|
|
|
$"Description: {Description}",
|
|
|
|
|
$"Manufacturer: {Manufacturer}",
|
|
|
|
|
$"DeviceID: {DeviceID}")}" +
|
|
|
|
|
$"\n\r";
|
2024-01-29 15:37:19 +01:00
|
|
|
|
}
|
|
|
|
|
}
|