54 lines
1.4 KiB
C#
54 lines
1.4 KiB
C#
namespace RobotNet10.Script.IO;
|
|
|
|
/// <summary>
|
|
/// Interface for ProfiNet connection operations.
|
|
/// </summary>
|
|
public interface IProfiNetConnection : IDisposable
|
|
{
|
|
/// <summary>
|
|
/// Gets the IP address of the ProfiNet device.
|
|
/// </summary>
|
|
string IpAddress { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the slot number.
|
|
/// </summary>
|
|
int Slot { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the subslot number.
|
|
/// </summary>
|
|
int Subslot { get; }
|
|
|
|
/// <summary>
|
|
/// Gets whether the connection is currently connected.
|
|
/// </summary>
|
|
bool IsConnected { get; }
|
|
|
|
/// <summary>
|
|
/// Connects to the ProfiNet device.
|
|
/// </summary>
|
|
Task ConnectAsync();
|
|
|
|
/// <summary>
|
|
/// Disconnects from the ProfiNet device.
|
|
/// </summary>
|
|
Task DisconnectAsync();
|
|
|
|
/// <summary>
|
|
/// Reads data from the ProfiNet device.
|
|
/// </summary>
|
|
/// <param name="index">The index to read from.</param>
|
|
/// <param name="length">The number of bytes to read.</param>
|
|
/// <returns>The read data as byte array.</returns>
|
|
Task<byte[]> ReadAsync(int index, int length);
|
|
|
|
/// <summary>
|
|
/// Writes data to the ProfiNet device.
|
|
/// </summary>
|
|
/// <param name="index">The index to write to.</param>
|
|
/// <param name="data">The data to write.</param>
|
|
Task WriteAsync(int index, byte[] data);
|
|
}
|
|
|