Files
BQP/srcs/RobotNet10/RobotApp/Communication/Sick.SafetyScanners/Interfaces/ICola2Session.cs
2026-07-13 09:25:40 +07:00

44 lines
1.1 KiB
C#

using Sick.SafetyScanners.Cola2.Commands;
using Sick.SafetyScanners.Types;
namespace Sick.SafetyScanners.Interfaces;
/// <summary>
/// Interface cho COLA2 session management
/// </summary>
public interface ICola2Session : IDisposable
{
/// <summary>
/// Gets the current session ID, if available
/// </summary>
uint? SessionId { get; }
/// <summary>
/// Indicates whether a COLA2 session is currently opened
/// </summary>
bool IsOpen { get; }
/// <summary>
/// Opens a COLA2 session
/// </summary>
void Open();
/// <summary>
/// Closes the current COLA2 session
/// </summary>
void Close();
/// <summary>
/// Sends a COLA2 command to the sensor and waits for response
/// </summary>
/// <param name="command">The command to send</param>
/// <param name="timeout">The timeout for the operation</param>
void SendCommand(ICola2Command command, TimeDuration? timeout = null);
/// <summary>
/// Gets the next request ID (thread-safe, auto-increments)
/// </summary>
ushort GetNextRequestId();
}