Implemented Device Identification (0x2B / 43) for TCP
This commit is contained in:
95
AMWD.Protocols.Modbus.Common/Models/DeviceIdentification.cs
Normal file
95
AMWD.Protocols.Modbus.Common/Models/DeviceIdentification.cs
Normal file
@@ -0,0 +1,95 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AMWD.Protocols.Modbus.Common
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the device identification.
|
||||
/// </summary>
|
||||
public class DeviceIdentification
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the vendor name.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Category: Basic
|
||||
/// <br/>
|
||||
/// Kind: Mandatory
|
||||
/// </remarks>
|
||||
public string VendorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the product code.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Category: Basic
|
||||
/// <br/>
|
||||
/// Kind: Mandatory
|
||||
/// </remarks>
|
||||
public string ProductCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the version in major, minor and revision.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Category: Basic
|
||||
/// <br/>
|
||||
/// Kind: Mandatory
|
||||
/// </remarks>
|
||||
public string MajorMinorRevision { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the vendor URL.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Category: Regular
|
||||
/// <br/>
|
||||
/// Kind: Optional
|
||||
/// </remarks>
|
||||
public string VendorUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the product name.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Category: Regular
|
||||
/// <br/>
|
||||
/// Kind: Optional
|
||||
/// </remarks>
|
||||
public string ProductName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the model name.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Category: Regular
|
||||
/// <br/>
|
||||
/// Kind: Optional
|
||||
/// </remarks>
|
||||
public string ModelName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the user application name.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Category: Regular
|
||||
/// <br/>
|
||||
/// Kind: Optional
|
||||
/// </remarks>
|
||||
public string UserApplicationName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the extended objects.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Category: Extended
|
||||
/// <br/>
|
||||
/// Kind: Optional
|
||||
/// </remarks>
|
||||
public Dictionary<byte, byte[]> ExtendedObjects { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether individual access (<see cref="ModbusDeviceIdentificationCategory.Individual"/>) is allowed.
|
||||
/// </summary>
|
||||
public bool IsIndividualAccessAllowed { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AMWD.Protocols.Modbus.Common
|
||||
{
|
||||
/// <summary>
|
||||
/// The raw device identification data as returned by the device (as spec defines).
|
||||
/// </summary>
|
||||
public class DeviceIdentificationRaw
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the conformity level allowes an idividual access.
|
||||
/// </summary>
|
||||
public bool AllowsIndividualAccess { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether more requests are needed.
|
||||
/// </summary>
|
||||
public bool MoreRequestsNeeded { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the next object id to request (if <see cref="MoreRequestsNeeded"/> is <see langword="true"/>).
|
||||
/// </summary>
|
||||
public byte NextObjectIdToRequest { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the objects with raw bytes.
|
||||
/// </summary>
|
||||
public Dictionary<byte, byte[]> Objects { get; set; } = [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user