Class AsciiReader
- Namespace
- TechnologySolutions.Rfid.AsciiOperations
- Assembly
- TechnologySolutions.Rfid.Operations.dll
Represents a reader that uses the Technology Solutions UK Ltd ASCII 2 Protocol to communicate with an RFID reader
public class AsciiReader : IAsciiReader, IReaderReaderOperation, IReader, IDisposable
- Inheritance
-
AsciiReader
- Implements
- Inherited Members
- Extension Methods
Constructors
AsciiReader()
Initializes a new instance of the TslReader class
public AsciiReader()
Properties
ActiveTransport
Gets the transport currently being used by this reader
public IAsciiTransport ActiveTransport { get; }
Property Value
Configuration
Gets the configuration of the reader
public IReaderConfiguration Configuration { get; }
Property Value
IsConnected
Gets a value indicating whether the reader is currently connected
public bool IsConnected { get; }
Property Value
Operations
Gets the operations run by this reader
public IEnumerable<IReaderOperation> Operations { get; }
Property Value
ResponseLog
Gets or sets an action that is called for each line received from the receiver ** USE FOR DEBUG ONLY **
public Action<string> ResponseLog { get; set; }
Property Value
Remarks
This gets or sets an method that is called for every line received from the reader. It is a LoggerResponder that first in the ResponderChain of the AsciiCommander therefore having a slow method here will greatly impact the reader responsiveness
SerialNumber
Gets the serial number of the reader
public string SerialNumber { get; }
Property Value
Transports
Gets the transports available to communicate to the reader this instance represents
public IEnumerable<IAsciiTransport> Transports { get; }
Property Value
Methods
AddOperation(IReaderOperation)
Adds the specified operation to the list of operations to run
public void AddOperation(IReaderOperation operation)
Parameters
operation
IReaderOperationThe operation to add
Remarks
An operation must be added to the reader in its disabled state. Once it has been added to the reader it will not do anything until it has been enabled. Once enabled it will act upon its trigger if specified or without a trigger can be run manually with StartOperation
AddResponder(IAsciiCommandResponder)
Adds the specified responder to the responder chain
public void AddResponder(IAsciiCommandResponder responder)
Parameters
responder
IAsciiCommandResponderThe responder to add
AddTransport(IAsciiTransport)
Adds a transport to the reader
public void AddTransport(IAsciiTransport transport)
Parameters
transport
IAsciiTransportThe transport to add
Remarks
A real reader can have multiple ways of connecting to it (e.g. USB and Bluetooth) so a reader instance holds all the connections to the reader so potentially it can maintain a connection to a reader by switching the transport it is using
ConnectAsync(IAsciiTransport)
Changes the ActiveTransport to transport
public Task ConnectAsync(IAsciiTransport transport)
Parameters
transport
IAsciiTransportThe new ActiveTransport
Returns
DisconnectAsync()
Disconnects the reader from the current ActiveTransport
public Task DisconnectAsync()
Returns
- Task
The task to disconnect the reader from the active transport
Dispose()
Disposes an instance of the TslReader class
public void Dispose()
Dispose(bool)
Disposes an instance of the TslReader class
protected virtual void Dispose(bool disposing)
Parameters
disposing
boolTrue to dispose managed as well as native resources
ExecuteAsync(AsciiCommandBase)
Execute the command synchronous (command gets its own response)
public Task ExecuteAsync(AsciiCommandBase command)
Parameters
command
AsciiCommandBaseThe command to execute
Returns
- Task
The task to execute the command
ExecuteAsync(TagAccessFilterFields, Action<TransponderData, bool>)
Allows an operation to perform a transponder command
public Task ExecuteAsync(TagAccessFilterFields accessFilterFields, Action<TransponderData, bool> transponderReceived)
Parameters
accessFilterFields
TagAccessFilterFieldsThe specification for the command to perform. If access is null an inventory is performed
transponderReceived
Action<TransponderData, bool>This action is called to report a transponder
Returns
- Task
The task to perform the transponder command
OperationEnabledChangedAsync()
Called by an operation when it is enabled or disabled
public Task OperationEnabledChangedAsync()
Returns
- Task
The task that updates the reader when an operation is enabled or disabled
OperationOfType<TOperation>()
Returns the first operation that supports the required
public TOperation OperationOfType<TOperation>() where TOperation : IReaderOperation
Returns
- TOperation
Type Parameters
TOperation
RefreshAsync()
This should be called as the list of transports change to ensure the reader is using the appropriate transport to the reader.
public Task RefreshAsync()
Returns
- Task
The task to maintain a connection to the reader by selecting the best transport
RemoveOperation(string)
Remove the operation, identified by operationIdentifier, from the reader
public IReaderOperation RemoveOperation(string operationIdentifier)
Parameters
operationIdentifier
stringThe identifier of the operation to remove
Returns
- IReaderOperation
The removed operation or null (Nothing in Visual Basic) if no operation with that identifier is found
Remarks
If an operation is found it will be stopped and disabled before being removed from the reader
RemoveResponder(IAsciiCommandResponder)
Remove the responder from the responder chain
public void RemoveResponder(IAsciiCommandResponder responder)
Parameters
responder
IAsciiCommandResponderThe responder to remove
RemoveTransport(IAsciiTransport)
Remove a transport from the reader
public void RemoveTransport(IAsciiTransport transport)
Parameters
transport
IAsciiTransportThe transport to remove
Remarks
A real reader can have multiple ways of connecting to it (e.g. USB and Bluetooth) so a reader instance holds all the connections to the reader so potentially it can maintain a connection to a reader by switching the transport it is using