Table of Contents

Interface IAsciiCommander

Namespace
TechnologySolutions.Rfid.AsciiProtocol
Assembly
TechnologySolutions.Rfid.AsciiProtocol.Core.dll

Provides methods and properties to handle the execution of IAsciiCommands

public interface IAsciiCommander
Extension Methods

Properties

IsResponsive

Gets a value indicating whether the last command completed as expected i.e. did not timeout.

bool IsResponsive { get; }

Property Value

bool

LastCommandLine

Gets the last command line sent

string LastCommandLine { get; }

Property Value

string

Remarks

Because TSLAsciiCommands add a unique id number each time their commandLine property is accessed this property can be used (primarily for debugging) to get the actual command line issued (if examined immediately after the command is executed)

Methods

AbortSynchronousCommand()

Terminates any executing synchronous command

void AbortSynchronousCommand()

Remarks

If ExecuteCommand is blocking waiting for a command response this will abort the call and the method will return. The synchronous command being executed will be left in an incomplete state with its response incomplete

CanExecuteCommand()

Returns a value indicating whether a command can be executed

bool CanExecuteCommand()

Returns

bool

True if ExecuteCommand can be called

Remarks

This should be false when the reader is not connected or currently executing a command

ExecuteCommand(IAsciiCommand, IAsciiCommandSynchronousResponder)

Execute the given command.

void ExecuteCommand(IAsciiCommand command, IAsciiCommandSynchronousResponder synchronousResponder)

Parameters

command IAsciiCommand

The command to be executed

synchronousResponder IAsciiCommandSynchronousResponder

For command to execute synchronously (not return until complete) set this to a responder to receive the command response. To execute the command asynchronously and let the responder chain handle the events set this to null

Remarks

Warning: derived classes must call the base implementation to ensure synchronous commands work correctly