Interface IReaderOperation
- Namespace
- TechnologySolutions.Rfid
- Assembly
- TechnologySolutions.Rfid.Operations.dll
Represents an operation performed by a IReader
public interface IReaderOperation : ITriggerSource
- Inherited Members
Remarks
An IReaderOperation must be added to an IReader in its Disabled state. The operation then needs to be enabled with a call to EnableAsync() before it can be started. Once enabled the operation will then be in its Inactive state. A call to StartAsync() will run the operation and the state will be Active until the operation completes when it returns to Inactive. The operation can be stopped/cancelled with a call to StopAsync() and StopAsync() should be called on an operation after it has been started. Before an operation can be removed from the IReader it must be disabled with a call to DisableAsync() to return the operation to the Disabled state. Most operations need to be in the Disabled state to change the properties (and hence behaviour) of the operation.
Operations can be triggered in one of three ways:
- Manual. The operation is started manually with a call to StartAsync() and stopped with a call to StopAsync()
- Software Trigger. The operation is commanded from the host when the reader reports the appropriate change in trigger state. The operation is started (with a call to StartAsync()) when the trigger is pressed and stopped (with a call to StopAsync()) when the trigger is released
- Hardware Trigger. The operation is run on the reader hardware and the events are reported back to the host.
If a TriggerInterval is set to MaxValue the operation is performed once. If the TriggerInterval is set to a value then this period will be waited before repeating the operation for manual or trigger operations. Hardware trigger operations do not respect the TriggerInterval property.
Properties
Identifier
Gets a unique identifier for the reader operation
string Identifier { get; }
Property Value
State
Gets the current state of the reader operation
ReaderOperationState State { get; }
Property Value
Methods
DisableAsync()
Disables the operation
Task DisableAsync()
Returns
- Task
The task to disable the operation
EnableAsync()
Enables the operation to be started (manually or by the specified trigger)
Task EnableAsync()
Returns
- Task
The task to enable the operation
StartAsync()
Returns a task that makes the reader operation active (only applicable to operations that can be started manually)
Task StartAsync()
Returns
- Task
The task to start the operation
StopAsync()
Stops the reader operation (change from active to inactive state)
Task StopAsync()
Returns
- Task
The task to stop the operation
Events
StateChanged
Raised when the State changes
event EventHandler<ReaderOperationEventArgs> StateChanged