using System.Collections.Generic;
using System.Text;
namespace AMWD.Protocols.Modbus.Common
{
///
/// Represents the device identification.
///
public class DeviceIdentification
{
///
/// Gets or sets the vendor name.
///
///
/// Category: Basic
///
/// Kind: Mandatory
///
public string VendorName { get; set; }
///
/// Gets or sets the product code.
///
///
/// Category: Basic
///
/// Kind: Mandatory
///
public string ProductCode { get; set; }
///
/// Gets or sets the version in major, minor and revision.
///
///
/// Category: Basic
///
/// Kind: Mandatory
///
public string MajorMinorRevision { get; set; }
///
/// Gets or sets the vendor URL.
///
///
/// Category: Regular
///
/// Kind: Optional
///
public string VendorUrl { get; set; }
///
/// Gets or sets the product name.
///
///
/// Category: Regular
///
/// Kind: Optional
///
public string ProductName { get; set; }
///
/// Gets or sets the model name.
///
///
/// Category: Regular
///
/// Kind: Optional
///
public string ModelName { get; set; }
///
/// Gets or sets the user application name.
///
///
/// Category: Regular
///
/// Kind: Optional
///
public string UserApplicationName { get; set; }
///
/// Gets or sets the extended objects.
///
///
/// Category: Extended
///
/// Kind: Optional
///
public Dictionary ExtendedObjects { get; set; } = [];
///
/// Gets or sets a value indicating whether individual access () is allowed.
///
public bool IsIndividualAccessAllowed { get; set; }
///
public override string ToString()
{
var sb = new StringBuilder();
sb.AppendLine(nameof(DeviceIdentification));
sb.AppendLine($" {nameof(VendorName)}: {VendorName}");
sb.AppendLine($" {nameof(ProductCode)}: {ProductCode}");
sb.AppendLine($" {nameof(MajorMinorRevision)}: {MajorMinorRevision}");
sb.AppendLine($" {nameof(VendorUrl)}: {VendorUrl}");
sb.AppendLine($" {nameof(ProductName)}: {ProductName}");
sb.AppendLine($" {nameof(ModelName)}: {ModelName}");
sb.AppendLine($" {nameof(UserApplicationName)}: {UserApplicationName}");
sb.AppendLine($" {nameof(IsIndividualAccessAllowed)}: {IsIndividualAccessAllowed}");
return sb.ToString();
}
}
}