Namespace TechnologySolutions.Rfid
IReaderOperations
The TechnologySolutions.Rfid namespace provides a high level API for performing RFID tasks. An IReader provides access to a number of IReaderOperations
An IReaderOperation must be added to a reader in its Disabled state. Once it has been added it can be enabled with a call to EnableAsync(). The operation should be disabled with a call to DisableAsync() before being removed from the IReader. An IReader provides an OperationOfType<TOperation>() to obtain a supported instance of the required operation.
Trigger Sources
An IReaderOperation has a ITriggerSource that determines how the operation is triggered. The operation can be manual, software or hardware triggered.
A manual trigger (TriggerIndex = 0
) is started with a call to StartAsync() and then stopped with a call to StopAsync()
A hardware trigger (TriggerIndex > 0, IsHardwareTrigger = true
) is where the operation is run on the reader itself and the
reader operation just listens to the responses from the reader to run the operation.
A software trigger (TriggerIndex > 0, IsHardwareTrigger = false
) is run on the host platform in response to changes
in the trigger state of the reader.
For Technology Solutions ASCII RFID Readers a TriggerIndex = 1
is a single press of the trigger and a TriggerIndex = 2
is a double press.
An operation also has a TriggerInterval
property. If this is set to TimeSpan.MaxValue
the operation is only run
once per start. For manual and software trigger trigger operations this can be set to a period at which the operation will
repeat while it is started.
Types of operation
Operation | Trigger | Description |
---|---|---|
IReaderOperationBarcode | Hardware | Performs a barcode scan in response to a trigger press using the reader's barcode scanner |
IReaderOperationBatteryStatus | Manual | Reports the battery status of the reader on a periodic basis |
IReaderOperationFindTag | Hardware | If the reader supports the .ft FindTag Command then this is used to locate a transponder. Otherwise this falls back to a custom .iv Inventory Command |
IReaderOperationHostBarcode | Software | Can be used to trigger a IHostBarcodeHandler in response to a trigger press on the reader (perform a barcode scan using the host's barcode engine) |
IReaderOperationInventory | Hardware | Perform inventory for the specified transponders using the reader hardware |
IReaderOperationTransponders | Manual | Perform a manually commanded inventory command |
IReaderOperationTranspondersAccess | Manual | Perform a manually commanded tag access command (Read, Write, Lock, Kill, Blockpermalock) |
Transponder Actions
A TagFilter is used to specify which transponders should be returned from and inventory.
A TagFields is used to specify what fields per transponder to return as a tag report.
A TagAccess is used to specify what action to perform for each transponder returned (read, write, lock, kill, blockpermalock)
A TagFilterFields combines a TagFilter and TagFields to complete a spec for an inventory operation. This can be used with an inventory type IReaderOperation or converted to an TechnologySolutions.Rfid.AsciiProtocol.Commands command with ToInventory(TagFilterFields, IReaderConfiguration)
A TagAccessFilterFields adds a TagAccess to a TagFilterFields to form a complete specification to perform a tag access command. This can be used with IReaderOperationTranspondersAccess or converted to an TechnologySolutions.Rfid.AsciiProtocol.Commands command with ToTagAccessCommand(TagAccessFilterFields, IAntennaParameterBounds)
These classes are intended to provide a concise way to describe the operation to perform using a fluent style syntax
// TagAccessFilterFields to read TID memory bank where the EPC starts with 11112222
var epcAndTid = TagFilter.ForMemory(MemoryBank.Epc, "11112222", TagMemoryOffset.Epc.Words, 2)
.ForInventory().ExpectMany()
.Report(TagFields.PC | TagFields.Epc)
.Read(MemoryBank.Tid, 0, 4);
// TagFilterFields to report the RSSI and EPC of the transponder with EPC 0123456789
var find = TagFilter.ForEpc("0123456789").ForTagFinding().ExpectOne()
.Report(TagFields.Epc | TagFields.Rssi);
Classes
- ReaderOperation
Base class for IReaderOperations
- ReaderOperationEventArgs
EventArgs to report ReaderOperationState
- ReaderOperationExtensions
Extension methods for reader operations
- ReaderOperationTransponders
An implementation of IReaderOperationTransponders to perform a transponder inventory manually or commanded from a trigger press
- ReaderOperationTranspondersAccess
An implementation of IReaderOperationTranspondersAccess that can perform transponder access manually or on a soft trigger
- TagAccess
Provides a specification to perform a tag access operation on a EPC Global C1G2 transponder including
- BlockPermalockLock(TagMemory, int, int, int)
- BlockPermalockRead(int, int, int)
- Kill(int, int)
- Lock(int, int)
- Read(MemoryBank, int, int, int)
- Write(MemoryBank, int, TagMemory, int)
This can be combined with a TagFilter (which specifies which tag(s) to access) into a TagAccessFilterFields for use with an IReaderOperationTranspondersAccess
e.g. Read(MemoryBank, int, int, int) to Read the user memory bank starting at word offset 0 for 4 words. Use Access password 0x11223344
TagAccess.Read(MemoryBank.User, /* offset */ 0, /* count */4, /*access password*/ 0x11223344);
- TagAccessExtensions
Extension methods for TagAccess
- TagAccessFilterFields
Adds a TagAccess specification to the TagFilterFields to specify all the information required to perform a TagAccessOperation on one or more transponders
- TagFilter
Declares the transponder or transponders to be returned from an RFID operation
Create a filter to identify transponders with a specific EPC
// Return all the transponders that have EPC '001122334455668877aabbccddeeff' using an output power of 20dBm TagFilter.ForEpc("001122334455668877aabbccddeeff").ForInventory().ExpectMany().AtPower(20);
// Find the one transponder with the specified serialized TID (manufacturer TID with unique serial number) TagFilter.ForTid(TagMemory.Parse("E280117020001089CCEB08DF")).ForTagFinding().ExpectOne();
// Return all the transponders where the user memory does not start with two blank words TagFilter.ForMemory(MemoryBank.User, "FFFFFFFF", 0, 32).ForInventory().NonMatching();
- TagFilterExtensions
Extension methods for TagFilters
- TagFilterFields
Extends a TagFilter to include which fields to return per transponder
- TagFoundEventArgs
Provides event data for the IReaderOperationFindTag operation
- TagMemory
Represents a block of transponder memory
- TranspondersEventArgs
Represents a collection of transponders reported from an inventory
Structs
- TagMemoryOffset
Helper class to identify the well known fields stored in the MemoryBanks
Interfaces
- IOutputPowerBounds
Defines the bounds for the output power setting
- IReader
High level abstraction of a reader that uses IReaderOperations to perform tasks
- IReaderConfiguration
Returns information about an IReader
- IReaderOperation
Represents an operation performed by a IReader
- IReaderOperationBarcode
An IReaderOperation that will perform a barcode scan for each press of the specified TriggerIndex
IsTriggerHardware is true TriggerIndex can be set before the operation is enabled. This is a hardware trigger operation. TriggerInterval is not used. Most barcode scanners perform one barcode scan per trigger
- IReaderOperationBatteryStatus
An IReaderOperation to report the battery status
IsTriggerHardware is false
TriggerIndex is 0 this is a manual operation
TriggerInterval is not used. Most barcode scanners perform one barcode scan per trigger
- IReaderOperationFindTag
An IReaderOperation to find a transponder specified by Filter
- IReaderOperationHostBarcode
An IReaderOperation that uses the change in trigger state of the specified TriggerIndex to trigger the barcode on the host device
- IReaderOperationInventory
An IReaderOperation that is hardware triggered that performs inventory while the trigger is pressed
- IReaderOperationTransponders
An IReaderOperation to perform inventory either manually or using a soft trigger (commanded from host while trigger pressed)
- IReaderOperationTranspondersAccess
An IReaderOperation to perform a TagAccess operation on one or more transponders either manually or using a soft trigger (commanded from host while trigger pressed)
- IReaderReaderOperation
Adds methods to the IReader interface required by IReaderOperations
- ITriggerSource
Identifies the trigger source for an IReaderOperation
Enums
- MemoryBank
Defines the memory banks of a EPC global C1G2 transponder
- ReaderOperationState
The states of a reader operation
- TagAccessOperation
Identifies the tag access operation to perform
- TagFields
Identifies fields per transponder to return
- TagFilterHint
Provides a hint for a TagFilter
- TagFinderState
The state of the IReaderOperationFindTag