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,42 @@
using Sick.SafetyScanners.DataStructures;
using Sick.SafetyScanners.Types;
namespace Sick.SafetyScanners.Interfaces;
/// <summary>
/// Interface for UDP receiver (not a connection - UDP is connectionless)
/// Used for receiving scan data packets from SICK Safety Scanner via UDP (push mode)
/// Note: This is NOT a "connection" - it's just a UDP socket receiver that binds to a local port
/// and waits for packets from the scanner
/// </summary>
public interface IUdpClient : IDisposable
{
/// <summary>
/// Indicates whether the UDP socket is open (ready to receive)
/// Note: UDP is connectionless, so this just checks if socket is bound/open
/// </summary>
bool IsConnected { get; }
/// <summary>
/// Gets the local port number assigned to this client
/// Returns null if socket is not bound yet
/// </summary>
Port? LocalPort { get; }
/// <summary>
/// Indicates whether data is available in the receiving buffer
/// </summary>
bool IsDataAvailable { get; }
/// <summary>
/// Starts receiving UDP packets on a dedicated high-priority thread
/// </summary>
/// <param name="packetHandler">Callback function to handle received packets</param>
void StartReceiving(Action<PacketBuffer> packetHandler);
/// <summary>
/// Stops the receiving thread
/// </summary>
void Stop();
}