Table of Contents

Class AsciiCommandBase

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

Base class for all ASCII commands

public abstract class AsciiCommandBase : IAsciiCommand
Inheritance
AsciiCommandBase
Implements
Derived
Inherited Members
Extension Methods

Constructors

AsciiCommandBase(string)

Initializes a new instance of the AsciiCommandBase class

protected AsciiCommandBase(string commandName)

Parameters

commandName string

The command name (e.g. ".iv" for inventory)

AsciiCommandBase(string, AsciiResponder)

Initializes a new instance of the AsciiCommandBase class

protected AsciiCommandBase(string commandName, AsciiResponder responder)

Parameters

commandName string

The command name (e.g. ".iv" for inventory)

responder AsciiResponder

The responder to use to capture the command response

Fields

LibraryCommandIdentifier

The value inserted into the command line to identify the command as a library command

public const string LibraryCommandIdentifier = "LCMD"

Field Value

string

Properties

AsciiResponse

Gets the internal responder used to process receiving responses

protected AsciiResponder AsciiResponse { get; }

Property Value

AsciiResponder

CommandName

Gets the command name of the command. '.' followed by two lower case characters to identify the command (e.g. ".iv")

public string CommandName { get; }

Property Value

string

IsIndexedCommand

Gets or sets a value indicating whether each command sent is given a sequential identifier. Also affects the responder to only respond to the command with the specific identifier

public bool IsIndexedCommand { get; set; }

Property Value

bool

IsLibraryCommand

Gets or sets a value indicating whether to insert a value into the command to identify the command as a library command. This also sets up the responder to only respond to commands that have the library command

public bool IsLibraryCommand { get; set; }

Property Value

bool

LastCommandLine

Gets or sets the last command line generated by CommandLine()

public string LastCommandLine { get; set; }

Property Value

string

MaxSynchronousWait

Gets or sets the maximum time to wait for this command to complete when invoked synchronously

public TimeSpan MaxSynchronousWait { get; set; }

Property Value

TimeSpan

Remarks

The default value is 3.0 seconds

MaxSynchronousWaitTime

Gets or sets the maximum time to wait for this command to complete when invoked synchronously

[Obsolete("Use MaxSynchronousWait. TimeSpan is more explicit about the unit used")]
public double MaxSynchronousWaitTime { get; set; }

Property Value

double

Parameters

Gets the parameters supported by this command

public ParameterCollection Parameters { get; }

Property Value

ParameterCollection

Responder

Gets the responder for the command that will populate Response

public IAsciiCommandSynchronousResponder Responder { get; }

Property Value

IAsciiCommandSynchronousResponder

Response

Gets the response received to this command for the last time it was executed

public IAsciiResponseResponder Response { get; }

Property Value

IAsciiResponseResponder

Methods

BuildCommandLine(StringBuilder)

Builds section of the command line part before the Parameters are appended.

protected virtual void BuildCommandLine(StringBuilder commandLine)

Parameters

commandLine StringBuilder

The command line to append to

Remarks

Override this method to replace or append what gets written to the command line before the parameters. When this responder is listening for the command start the "CS" value before the parameters must match the built command line before the parameters for the command to be started.

Appends the CommandName to the command line Appends LibraryCommandIdentifier to the command line after CommandName and before the parameters if IsLibraryCommand is true. Then inserts a sequential identifier into the command line if IsIndexedCommand is true

CommandLine()

Returns the ASCII command line (including terminators) to be sent to the device

public virtual string CommandLine()

Returns

string

The command line to send this command

ToString()

Returns a string representation of this instance

public override string ToString()

Returns

string

The name of the command