Metratec devices library 3.1.1.0
Public Member Functions | Protected Member Functions | List of all members
MetraTecDevices.UhfReaderGen2 Class Reference

The reader class for the ASCII based metratec reader. More...

Inheritance diagram for MetraTecDevices.UhfReaderGen2:
MetraTecDevices.MetratecReaderGen2< UhfTag > MetraTecDevices.PulsarLR

Public Member Functions

 UhfReaderGen2 (ICommunicationInterface connection)
 The reader class for all Metratec reader.
 
 UhfReaderGen2 (ICommunicationInterface connection, ILogger logger)
 The reader class for all Metratec reader.
 
 UhfReaderGen2 (ICommunicationInterface connection, string id)
 The reader class for all Metratec reader.
 
 UhfReaderGen2 (ICommunicationInterface connection, string id, ILogger logger)
 The reader class for all Metratec reader.
 
InventorySettings GetInventorySettings ()
 Return the current inventory settings.
 
void SetInventorySettings (InventorySettings settings)
 Sets the inventory settings.
 
TagCountSetting GetTagCountSetting ()
 Returns the tag count setting.
 
void SetTagCountSettings (TagCountSetting settings)
 Sets the expected tag count.
 
override void SetPower (int power)
 Set the reader power.
 
int GetPower ()
 Get the current reader power.
 
void SetRegion (REGION_GEN2 region)
 Set the region.
 
REGION_GEN2 GetRegion ()
 Get the current region.
 
override List< UhfTagGetInventory ()
 Scan for the current inventory.
 
List< UhfTagGetInventoryReport ()
 Get the current inventory report.
 
override void StartInventory ()
 Starts the continuous inventory scan. Make sure that the inventory is set.
 
void StartInventoryReport ()
 Start the continuous inventory report scan.
 
void StopInventoryReport ()
 Stops the continuous inventory report scan.
 
void SetMask (MEMBANK_GEN2 membank, int startAddress, string mask)
 Set the reader mask.
 
void SetEpcMask (string mask)
 Set the epc mask.
 
void SetEpcMask (int startAddress, string mask)
 Set the epc mask.
 
void ResetMask ()
 Reset/Disable the current reader mask.
 
void SetBitmask (MEMBANK_GEN2 membank, int startAddress, string mask)
 Set the reader bit mask.
 
void ResetBitmask ()
 Reset/Disable the current reader bitmask.
 
List< UhfTagReadTagData (MEMBANK_GEN2 memory, int startAddress, int length, String epcMask="")
 Read tag data.
 
List< UhfTagReadTagTid (int startAddress, int length, String epcMask="")
 Read the tag TIDs.
 
List< UhfTagReadTagUsrData (int startAddress, int length, String epcMask="")
 Read the tag user data.
 
List< UhfTagWriteTagData (MEMBANK_GEN2 memory, int startAddress, string data, string epcMask="")
 Write data to a tag.
 
- Public Member Functions inherited from MetraTecDevices.MetratecReaderGen2< UhfTag >
 MetratecReaderGen2 (ICommunicationInterface connection)
 The reader class for all Metratec reader.
 
 MetratecReaderGen2 (ICommunicationInterface connection, ILogger logger)
 The reader class for all Metratec reader.
 
 MetratecReaderGen2 (ICommunicationInterface connection, string id)
 The reader class for all Metratec reader.
 
 MetratecReaderGen2 (ICommunicationInterface connection, string id, ILogger logger)
 The reader class for all Metratec reader.
 
override string ExecuteCommand (string command, int timeout=10000)
 Send a command and returns the response.
 
override bool GetInput (int pin)
 Returns true if the input pin is high, otherwise false.
 
void EnableInputEvents (bool enable=true)
 Enable or disable input events.
 
override void SetOutput (int pin, bool value)
 Sets a output pin.
 
bool GetOutput (int pin)
 Returns true if the output pin is high, otherwise false.
 
override void SetAntenna (int antennaPort)
 Sets the current antenna to use.
 
int GetAntenna ()
 Gets the current used single antenna.
 
override void SetAntennaMultiplex (int antennasToUse)
 Sets the number of antennas to be multiplexed.
 
void SetAntennaMultiplex (List< int > antennaSequence)
 Sets the antenna multiplex sequence. Set the order in which the antennas are activated.
 
virtual List< int > GetAntennaMultiplex ()
 Gets the number of antennas to be multiplexed.
 
override void StopInventory ()
 Stops the continuous inventory scan.
 

Protected Member Functions

override void PrepareReader ()
 Configure the reader. The base implementation must be called after success.
 
override void ConfigureReader ()
 Configure the reader. The base implementation must be called after success.
 
override void HandleInventoryEvent (string response)
 Parse the inventory event (+CINV, +CMINV, +CINVR)
 
- Protected Member Functions inherited from MetraTecDevices.MetratecReaderGen2< UhfTag >
void SetCommand (String command)
 Send a command and check if the response contains "OK".
 
String GetCommand (String command)
 Send a command and check if the response contains "OK".
 
string[] SplitResponse (string response)
 Split a multiline response (and check the crc)
 
string[] SplitLine (string responseLine)
 Split a line response (and check the crc)
 
void FireInputChangeEvent (int inputPin, bool isHigh)
 Fire a inventory event.
 
override void HandleResponse (string response)
 Process the reader response...override for event check The base implementation must be called after success.
 
abstract void HandleInventoryEvent (string response)
 Parse the inventory event (+CINV, +CMINV, +CINVR)
 
override void PrepareReader ()
 Configure the reader. The base implementation must be called after success.
 
override void ConfigureReader ()
 Configure the reader. The base implementation must be called after success.
 
InvalidOperationException ParseErrorResponse (String response)
 Parse the error response and throw a InvalidOperationException with a detailed message.
 
override void SetHeartBeatInterval (int intervalInSec)
 Set the HeartBeatInterval ... override for send the heartbeat command. The base implementation must be called after success.
 
override void UpdateDeviceRevisions ()
 Returns the firmware revision ({firmware} {version})
 

Additional Inherited Members

- Properties inherited from MetraTecDevices.MetratecReaderGen2< UhfTag >
int CurrentAntennaPort [get, set]
 Current antenna port.
 
bool SingleAntennaInUse [get, set]
 True, if a single antenna is in use.
 
- Events inherited from MetraTecDevices.MetratecReaderGen2< UhfTag >
EventHandler< InputChangedEventArgs >? InputChanged
 Input change event handler.
 

Detailed Description

The reader class for the ASCII based metratec reader.

Constructor & Destructor Documentation

◆ UhfReaderGen2() [1/4]

MetraTecDevices.UhfReaderGen2.UhfReaderGen2 ( ICommunicationInterface  connection)

The reader class for all Metratec reader.

Parameters
connectionThe connection interface

◆ UhfReaderGen2() [2/4]

MetraTecDevices.UhfReaderGen2.UhfReaderGen2 ( ICommunicationInterface  connection,
ILogger  logger 
)

The reader class for all Metratec reader.

Parameters
connectionThe connection interface
loggerThe connection interface

◆ UhfReaderGen2() [3/4]

MetraTecDevices.UhfReaderGen2.UhfReaderGen2 ( ICommunicationInterface  connection,
string  id 
)

The reader class for all Metratec reader.

Parameters
connectionThe connection interface

///

Parameters
idThe reader id

◆ UhfReaderGen2() [4/4]

MetraTecDevices.UhfReaderGen2.UhfReaderGen2 ( ICommunicationInterface  connection,
string  id,
ILogger  logger 
)

The reader class for all Metratec reader.

Parameters
connectionThe connection interface
idThe reader id
loggerThe connection interface

Member Function Documentation

◆ GetInventory()

override List< UhfTag > MetraTecDevices.UhfReaderGen2.GetInventory ( )

Scan for the current inventory.

Exceptions
T:System.InvalidOperationExceptionIf the reader return an error
T:System.TimeoutExceptionThrown if the reader does not responding in time
T:System.ObjectDisposedExceptionIf the reader is not connected or the connection is lost

◆ GetInventoryReport()

List< UhfTag > MetraTecDevices.UhfReaderGen2.GetInventoryReport ( )

Get the current inventory report.

Exceptions
T:System.InvalidOperationExceptionIf the reader return an error
T:System.TimeoutExceptionThrown if the reader does not responding in time
T:System.ObjectDisposedExceptionIf the reader is not connected or the connection is lost

◆ GetInventorySettings()

InventorySettings MetraTecDevices.UhfReaderGen2.GetInventorySettings ( )

Return the current inventory settings.

Returns
The current inventory settings

◆ GetPower()

int MetraTecDevices.UhfReaderGen2.GetPower ( )

Get the current reader power.

Exceptions
T:System.InvalidOperationExceptionIf the reader return an error
T:System.TimeoutExceptionThrown if the reader does not responding in time
T:System.ObjectDisposedExceptionIf the reader is not connected or the connection is lost

◆ GetRegion()

REGION_GEN2 MetraTecDevices.UhfReaderGen2.GetRegion ( )

Get the current region.

Exceptions
T:System.InvalidOperationExceptionIf the reader return an error
T:System.TimeoutExceptionThrown if the reader does not responding in time
T:System.ObjectDisposedExceptionIf the reader is not connected or the connection is lost

◆ GetTagCountSetting()

TagCountSetting MetraTecDevices.UhfReaderGen2.GetTagCountSetting ( )

Returns the tag count setting.

Returns
the tag count setting

◆ HandleInventoryEvent()

override void MetraTecDevices.UhfReaderGen2.HandleInventoryEvent ( string  response)
protectedvirtual

Parse the inventory event (+CINV, +CMINV, +CINVR)

Parameters
response

Implements MetraTecDevices.MetratecReaderGen2< UhfTag >.

◆ ReadTagData()

List< UhfTag > MetraTecDevices.UhfReaderGen2.ReadTagData ( MEMBANK_GEN2  memory,
int  startAddress,
int  length,
String  epcMask = "" 
)

Read tag data.

Parameters
memorythe memory bank to read [TID, USR, EPC]
startAddressthe start address
lengththe bytes to read
epcMaskthe epc mask to use, optional
Returns
List with processed tags. If the tag has error, the kill was not successful

◆ ReadTagTid()

List< UhfTag > MetraTecDevices.UhfReaderGen2.ReadTagTid ( int  startAddress,
int  length,
String  epcMask = "" 
)

Read the tag TIDs.

Parameters
startAddressstartAddress
lengthbytes to read from the tid
epcMaskthe epc mask to use, optional
Returns
List with processed tags. If the tag has error, the kill was not successful

◆ ReadTagUsrData()

List< UhfTag > MetraTecDevices.UhfReaderGen2.ReadTagUsrData ( int  startAddress,
int  length,
String  epcMask = "" 
)

Read the tag user data.

Parameters
startAddressstartAddress
lengthbytes to read from the user data
epcMaskthe epc mask to use, optional
Returns
List with processed tags. If the tag has error, the kill was not successful

◆ SetBitmask()

void MetraTecDevices.UhfReaderGen2.SetBitmask ( MEMBANK_GEN2  membank,
int  startAddress,
string  mask 
)

Set the reader bit mask.

Parameters
membankthe memory bank to check
startAddressthe start address
maskthe binary mask, e.g. '0110'

◆ SetEpcMask() [1/2]

void MetraTecDevices.UhfReaderGen2.SetEpcMask ( int  startAddress,
string  mask 
)

Set the epc mask.

Parameters
startAddressthe start address
maskthe mask

◆ SetEpcMask() [2/2]

void MetraTecDevices.UhfReaderGen2.SetEpcMask ( string  mask)

Set the epc mask.

Parameters
maskthe mask

◆ SetInventorySettings()

void MetraTecDevices.UhfReaderGen2.SetInventorySettings ( InventorySettings  settings)

Sets the inventory settings.

Parameters
settingsthe inventory settings

◆ SetMask()

void MetraTecDevices.UhfReaderGen2.SetMask ( MEMBANK_GEN2  membank,
int  startAddress,
string  mask 
)

Set the reader mask.

Parameters
membankthe memory bank to check
startAddressthe start address
maskthe mask

◆ SetPower()

override void MetraTecDevices.UhfReaderGen2.SetPower ( int  power)

Set the reader power.

Parameters
powerthe reader power
Exceptions
T:System.InvalidOperationExceptionIf the reader return an error
T:System.TimeoutExceptionThrown if the reader does not responding in time
T:System.ObjectDisposedExceptionIf the reader is not connected or the connection is lost

◆ SetRegion()

void MetraTecDevices.UhfReaderGen2.SetRegion ( REGION_GEN2  region)

Set the region.

Parameters
regionthe region to set
Exceptions
T:System.InvalidOperationExceptionIf the reader return an error
T:System.TimeoutExceptionThrown if the reader does not responding in time
T:System.ObjectDisposedExceptionIf the reader is not connected or the connection is lost

◆ SetTagCountSettings()

void MetraTecDevices.UhfReaderGen2.SetTagCountSettings ( TagCountSetting  settings)

Sets the expected tag count.

Parameters
settingsthe tag count settings

◆ StartInventory()

override void MetraTecDevices.UhfReaderGen2.StartInventory ( )

Starts the continuous inventory scan. Make sure that the inventory is set.

Exceptions
T:System.InvalidOperationExceptionIf the reader return an error
T:System.TimeoutExceptionThrown if the reader does not responding in time
T:System.ObjectDisposedExceptionIf the reader is not connected or the connection is lost

◆ StartInventoryReport()

void MetraTecDevices.UhfReaderGen2.StartInventoryReport ( )

Start the continuous inventory report scan.

Exceptions
T:System.TimeoutExceptionThrown if the reader does not responding in time
T:System.ObjectDisposedException/// If the reader is not connected or the connection is lost

◆ StopInventoryReport()

void MetraTecDevices.UhfReaderGen2.StopInventoryReport ( )

Stops the continuous inventory report scan.

Exceptions
T:System.TimeoutExceptionThrown if the reader does not responding in time
T:System.ObjectDisposedException/// If the reader is not connected or the connection is lost

◆ WriteTagData()

List< UhfTag > MetraTecDevices.UhfReaderGen2.WriteTagData ( MEMBANK_GEN2  memory,
int  startAddress,
string  data,
string  epcMask = "" 
)

Write data to a tag.

Parameters
memorytag memory to use
startAddressstart address
datadata, hex string
epcMaskecp mask, optional
Returns
List with processed tags. If the tag has error, the kill was not successful

The documentation for this class was generated from the following file: