Initial commit

This commit is contained in:
2026-07-13 09:25:40 +07:00
parent c08ff54676
commit bccfb156d7
1938 changed files with 641646 additions and 0 deletions

View File

@@ -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);
}