Initial commit
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
using Sick.SafetyScanners.DataStructures;
|
||||
using Sick.SafetyScanners.Types;
|
||||
|
||||
namespace Sick.SafetyScanners.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
/// Interface cho TCP client communication
|
||||
/// </summary>
|
||||
public interface ITcpClient : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Server IP address
|
||||
/// </summary>
|
||||
IpAddress ServerIp { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Server port
|
||||
/// </summary>
|
||||
Port ServerPort { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the TCP socket is currently connected
|
||||
/// </summary>
|
||||
bool IsConnected { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Establishes a connection to the sensor
|
||||
/// </summary>
|
||||
/// <param name="timeout">Timeout for connection</param>
|
||||
void Connect(TimeDuration? timeout = null);
|
||||
|
||||
/// <summary>
|
||||
/// Disconnects from the sensor
|
||||
/// </summary>
|
||||
void Disconnect();
|
||||
|
||||
/// <summary>
|
||||
/// Sends data to the sensor
|
||||
/// </summary>
|
||||
/// <param name="data">Data to send</param>
|
||||
void Send(ReadOnlyMemory<byte> data);
|
||||
|
||||
/// <summary>
|
||||
/// Receives data from the sensor
|
||||
/// </summary>
|
||||
/// <param name="timeout">Timeout for receive operation</param>
|
||||
/// <returns>Received packet buffer</returns>
|
||||
PacketBuffer Receive(TimeDuration? timeout = null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user