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,49 @@
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; }
}