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
stringThe 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
stringThe command name (e.g. ".iv" for inventory)
responder
AsciiResponderThe 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
Properties
AsciiResponse
Gets the internal responder used to process receiving responses
protected AsciiResponder AsciiResponse { get; }
Property Value
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
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
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
LastCommandLine
Gets or sets the last command line generated by CommandLine()
public string LastCommandLine { get; set; }
Property Value
MaxSynchronousWait
Gets or sets the maximum time to wait for this command to complete when invoked synchronously
public TimeSpan MaxSynchronousWait { get; set; }
Property Value
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
Parameters
Gets the parameters supported by this command
public ParameterCollection Parameters { get; }
Property Value
Responder
Gets the responder for the command that will populate Response
public IAsciiCommandSynchronousResponder Responder { get; }
Property Value
Response
Gets the response received to this command for the last time it was executed
public IAsciiResponseResponder Response { get; }
Property Value
Methods
BuildCommandLine(StringBuilder)
Builds section of the command line part before the Parameters are appended.
protected virtual void BuildCommandLine(StringBuilder commandLine)
Parameters
commandLine
StringBuilderThe 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