Initial commit

This commit is contained in:
2026-07-03 16:37:12 +07:00
commit 63b8c1ea8b
1931 changed files with 640587 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
namespace Sick.SafetyScanners.Cola2.Commands;
/// <summary>
/// Command to close a COLA2 session
/// </summary>
public sealed class CloseSessionCommand : CommandBase
{
public CloseSessionCommand()
: base(0x43, 0x58) // 'C' and 'X' in ASCII
{
}
public override bool CanBeExecutedWithoutSessionId => false;
protected override ReadOnlyMemory<byte> AddTelegramData()
{
// Close session command has no additional data
return ReadOnlyMemory<byte>.Empty;
}
protected override bool ProcessReplyInternal(ReadOnlyMemory<byte> replyData,
byte replyCommandType, byte replyCommandMode)
{
// Reply should be 'C' (0x43) and 'A' (0x41) for Acknowledge
if ((replyCommandType == 0x43 && replyCommandMode == 0x41) ||
(replyCommandType == 'C' && replyCommandMode == 'A'))
{
return true;
}
return false;
}
}