50 lines
1.4 KiB
C#
50 lines
1.4 KiB
C#
namespace Sick.SafetyScanners.Cola2.Commands;
|
|
|
|
/// <summary>
|
|
/// Base interface for all COLA2 commands
|
|
/// </summary>
|
|
public interface ICola2Command
|
|
{
|
|
/// <summary>
|
|
/// Command type (e.g., 'R' for Read, 'W' for Write, 'O' for Method)
|
|
/// </summary>
|
|
byte CommandType { get; }
|
|
|
|
/// <summary>
|
|
/// Command mode (e.g., 'I' for Index, 'N' for Name)
|
|
/// </summary>
|
|
byte CommandMode { get; }
|
|
|
|
/// <summary>
|
|
/// Session ID (set by Cola2Session)
|
|
/// </summary>
|
|
uint SessionId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Request ID (set by Cola2Session)
|
|
/// </summary>
|
|
ushort RequestId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Indicates if the command was successfully executed
|
|
/// </summary>
|
|
bool WasSuccessful { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the data vector for the command payload
|
|
/// </summary>
|
|
ReadOnlyMemory<byte> GetDataVector();
|
|
|
|
/// <summary>
|
|
/// Processes the reply from the sensor
|
|
/// </summary>
|
|
/// <param name="replyData">The reply data from the sensor</param>
|
|
bool ProcessReply(ReadOnlyMemory<byte> replyData, byte replyCommandType, byte replyCommandMode);
|
|
|
|
/// <summary>
|
|
/// Indicates if the command can be executed without a session ID
|
|
/// </summary>
|
|
bool CanBeExecutedWithoutSessionId { get; }
|
|
}
|
|
|