UGrokItApi.UgiInventory Class Reference

Overview

An inventory session

Instance Methods

void StopInventory (Action del)
 Stop running inventory with a completion to call when completed More...
 
UgiTag TagByEpc (UgiEpc epc)
 Get a tag by EPC More...
 
void PauseInventory ()
 Stop running inventory temporarily (such as while a dialog box is displayed) More...
 
void ResumeInventory ()
 Restart inventory after a temporarily stop More...
 
void ResumeInventory (UgiRfidConfiguration configuration)
 Restart inventory after a temporarily stop, using a new configuration More...
 
delegate void TagAccessDelegate (UgiTag tag, TagAccessReturnValues result)
 Delegate type for ProgramTag, WriteTag, LockUnlockTag More...
 
void ProgramTag (UgiEpc oldEpc, UgiEpc newEpc, int password, TagAccessDelegate completionDelegate)
 Programs a tag. This must be called while inventory is running. This method call returns immediately, the delegate object is informed of the success or failure of the programming. NOTE: the byte length of the newEpc must be the same as the oldEpc. More...
 
void WriteTag (UgiEpc epc, UgiRfidConfiguration.MemoryBank memoryBank, int offset, byte[] data, byte[] previousData, int password, TagAccessDelegate completionDelegate)
 Write memory. This must be called while inventory is running. This method call returns immediately, the delegate object is informed of the success or failure of the write. More...
 
void SetTagAccessPassword (UgiEpc epc, int currentPassword, int newPassword, TagAccessDelegate completionDelegate)
 Sets the tag's access password More...
 
void SetTagKillPassword (UgiEpc epc, int currentPassword, int killPassword, TagAccessDelegate completionDelegate)
 Set a tag's kill password More...
 
void LockUnlockTag (UgiEpc epc, int maskAndAction, int password, TagAccessDelegate completionDelegate)
 Lock/unlock a tag More...
 
void KillTag (UgiEpc epc, int password, TagAccessDelegate completionDelegate)
 Kill a tag More...
 
delegate void TagReadDelegate (UgiTag tag, byte[] data, TagAccessReturnValues result)
 Delegate type for ReadTag More...
 
void ReadTag (UgiEpc epc, UgiRfidConfiguration.MemoryBank memoryBank, int offset, int minNumBytes, int maxNumBytes, int password, TagReadDelegate completionDelegate)
 Read a tag's memory More...
 
delegate void TagCustomCommandDelegate (UgiTag tag, bool headerBit, byte[] response, TagAccessReturnValues result)
 Delegate type for CustomCommandToTag More...
 
void CustomCommandToTag (UgiEpc epc, byte[] command, int commandBits, int responseBitLengthNoHeaderBit, int responseBitLengthWithHeaderBit, int receiveTimeoutUsec, TagCustomCommandDelegate completionDelegate)
 Do a custom command to a tag More...
 
delegate void ChangePowerDelegate (bool success)
 Delegate type for ChangePower More...
 
void ChangePower (double initialPowerLevel, double minPowerLevel, double maxPowerLevel, ChangePowerDelegate completionDelegate)
 Changes the power More...
 
void GetBatteryInfo (Action< Ugi.BatteryInfo > completion)
 Get battery level while scanning More...
 

Properties

IUgiInventoryDelegate Delegate [get, set]
 Gets or sets the inventory delegate. More...
 
UgiRfidConfiguration Configuration [get]
 The configuration used for this inventory More...
 
DateTime StartTime [get]
 When this inventory started (local time, to be consistent with DateTime.Now) More...
 
List< UgiTagTags [get]
 Get all the tags found in this inventory More...
 
bool IsPaused [get]
 Is inventory paused? More...
 
bool IsScanning [get]
 Is the Grokker actively scanning? More...
 
int NumInventoryRounds [get]
 Get the number of inventory rounds that the Grokker has run in this inventory More...
 

Structures

class  LockUnlockMaskAndAction
 Definitions for value passed to lockUnlockTag choosing what banks to change the locked status for and what to change them to More...
 
class  StopInventoryDelegateHelper
 

Types

enum  InventoryResults {
  InventoryResults.Ok, InventoryResults.ErrorSending = 98, InventoryResults.LostConnection = 99, InventoryResults.BatteryTooLow = 7,
  InventoryResults.TemperatureTooHigh = 8, InventoryResults.NotProvisioned = 9, InventoryResults.RegionNotSet = 10
}
 Inventory results, passed to InventoryDidStop More...
 
enum  TagAccessReturnValues {
  TagAccessReturnValues.Ok, TagAccessReturnValues.WrongPassword, TagAccessReturnValues.PasswordRequired, TagAccessReturnValues.MemoryOverrun,
  TagAccessReturnValues.TagNotFound, TagAccessReturnValues.GeneralError, TagAccessReturnValues.InventoryStopped, TagAccessReturnValues.RequiresAuthentication
}
 Return values from ProgramTag, WriteTag, LockUnlockTag and ReadTag More...
 

Public Attributes

const int NO_PASSWORD = 0
 Default password, meaning the tag is not password protected More...
 

Instance Method Documentation

◆ StopInventory()

void UGrokItApi.UgiInventory.StopInventory ( Action  del)
inline

Stop running inventory with a completion to call when completed

Parameters
delDelegate to call when completed

◆ TagByEpc()

UgiTag UGrokItApi.UgiInventory.TagByEpc ( UgiEpc  epc)
inline

Get a tag by EPC

Parameters
epcEpc
Returns
Tag

◆ PauseInventory()

void UGrokItApi.UgiInventory.PauseInventory ( )
inline

Stop running inventory temporarily (such as while a dialog box is displayed)

◆ ResumeInventory() [1/2]

void UGrokItApi.UgiInventory.ResumeInventory ( )
inline

Restart inventory after a temporarily stop

◆ ResumeInventory() [2/2]

void UGrokItApi.UgiInventory.ResumeInventory ( UgiRfidConfiguration  configuration)
inline

Restart inventory after a temporarily stop, using a new configuration

Parameters
configurationNew configuration to use

◆ TagAccessDelegate()

delegate void UGrokItApi.UgiInventory.TagAccessDelegate ( UgiTag  tag,
TagAccessReturnValues  result 
)

Delegate type for ProgramTag, WriteTag, LockUnlockTag

Parameters
tagTag accessed
resultResult of the tag access

◆ ProgramTag()

void UGrokItApi.UgiInventory.ProgramTag ( UgiEpc  oldEpc,
UgiEpc  newEpc,
int  password,
TagAccessDelegate  completionDelegate 
)
inline

Programs a tag. This must be called while inventory is running. This method call returns immediately, the delegate object is informed of the success or failure of the programming. NOTE: the byte length of the newEpc must be the same as the oldEpc.

Parameters
oldEpcEPC of tag to change
newEpcEPC to write to the tag
passwordPassword to use (NO_PASSWORD for not password protected)
completionDelegateCode to execute after tag is programmed

◆ WriteTag()

void UGrokItApi.UgiInventory.WriteTag ( UgiEpc  epc,
UgiRfidConfiguration.MemoryBank  memoryBank,
int  offset,
byte []  data,
byte []  previousData,
int  password,
TagAccessDelegate  completionDelegate 
)
inline

Write memory. This must be called while inventory is running. This method call returns immediately, the delegate object is informed of the success or failure of the write.

Parameters
epcEPC of tag to write to
memoryBankMemory bank to write to
offsetByte offset to write at (must be a multiple of 2)
dataData to write
previousDataPrevious value for this data (null if unknown or not available)
passwordPassword to use (NO_PASSWORD for not password protected)
completionDelegateCode to execute after tag is written

◆ SetTagAccessPassword()

void UGrokItApi.UgiInventory.SetTagAccessPassword ( UgiEpc  epc,
int  currentPassword,
int  newPassword,
TagAccessDelegate  completionDelegate 
)
inline

Sets the tag's access password

Parameters
epcEPC of tag to set the password for
currentPasswordCurrent password (UGI_NO_PASSWORD if not password protected)
newPasswordPassword to set (UGI_NO_PASSWORD for not password protected)
completionDelegateCode to execute after tag's password is set

◆ SetTagKillPassword()

void UGrokItApi.UgiInventory.SetTagKillPassword ( UgiEpc  epc,
int  currentPassword,
int  killPassword,
TagAccessDelegate  completionDelegate 
)
inline

Set a tag's kill password

Parameters
epcEPC of tag to set the password for
currentPasswordCurrent password (UGI_NO_PASSWORD if not password protected)
killPasswordKill password to set (UGI_NO_PASSWORD for not password protected)
completionDelegateCode to execute after tag's kill password is set

◆ LockUnlockTag()

void UGrokItApi.UgiInventory.LockUnlockTag ( UgiEpc  epc,
int  maskAndAction,
int  password,
TagAccessDelegate  completionDelegate 
)
inline

Lock/unlock a tag

Parameters
epcEPC of tag to lock/unlock
maskAndActionDescription for which protection bits to change and what to change them to (UgiLockUnlockMaskAndAction)
passwordPassword to use (NO_PASSWORD for not password protected)
completionDelegateCode to execute after tag is locked/unlocked

◆ KillTag()

void UGrokItApi.UgiInventory.KillTag ( UgiEpc  epc,
int  password,
TagAccessDelegate  completionDelegate 
)
inline

Kill a tag

Parameters
epcEPC of tag to kill
passwordKill password
completionDelegateCode to execute after tag is killed

◆ TagReadDelegate()

delegate void UGrokItApi.UgiInventory.TagReadDelegate ( UgiTag  tag,
byte []  data,
TagAccessReturnValues  result 
)

Delegate type for ReadTag

Parameters
tagTag accessed
dataData read from tag
resultResult of the tag access

◆ ReadTag()

void UGrokItApi.UgiInventory.ReadTag ( UgiEpc  epc,
UgiRfidConfiguration.MemoryBank  memoryBank,
int  offset,
int  minNumBytes,
int  maxNumBytes,
int  password,
TagReadDelegate  completionDelegate 
)
inline

Read a tag's memory

Parameters
epcEPC of tag to read
memoryBankMemory bank to read
offsetByte offset to read at (must be a multiple of 2)
minNumBytesMinimum number of bytes to read (must be a multiple of 2)
maxNumBytesMaximum number of bytes to read (must be a multiple of 2)
passwordPassword to use (NO_PASSWORD for not password protected)
completionDelegateCode to execute after tag is read

◆ TagCustomCommandDelegate()

delegate void UGrokItApi.UgiInventory.TagCustomCommandDelegate ( UgiTag  tag,
bool  headerBit,
byte []  response,
TagAccessReturnValues  result 
)

Delegate type for CustomCommandToTag

Parameters
tagTag accessed
headerBittrue if the header bit was set in the response (usually used to indicate an error)
responseResponse to the command
resultResult of the tag access

◆ CustomCommandToTag()

void UGrokItApi.UgiInventory.CustomCommandToTag ( UgiEpc  epc,
byte []  command,
int  commandBits,
int  responseBitLengthNoHeaderBit,
int  responseBitLengthWithHeaderBit,
int  receiveTimeoutUsec,
TagCustomCommandDelegate  completionDelegate 
)
inline

Do a custom command to a tag

Parameters
epcEPC of tag to send the custom command to
commandCommand bytes to send
commandBitsNumber of command bits to send
responseBitLengthNoHeaderBitNumber of response bits to expect, if header bit is not set in the response
responseBitLengthWithHeaderBitNumber of response bits to expect, if header bit is set in the response (if 0 then do not expect a header bit at all)
receiveTimeoutUsecResponse timeout in uSec (some tags require more than the standard for custom commands)
completionDelegateCode to execute after the custom command is executed

◆ ChangePowerDelegate()

delegate void UGrokItApi.UgiInventory.ChangePowerDelegate ( bool  success)

Delegate type for ChangePower

Parameters
successtrue if power changed successfully

◆ ChangePower()

void UGrokItApi.UgiInventory.ChangePower ( double  initialPowerLevel,
double  minPowerLevel,
double  maxPowerLevel,
ChangePowerDelegate  completionDelegate 
)
inline

Changes the power

Parameters
initialPowerLevelInitial power level
minPowerLevelMinimum power level
maxPowerLevelMaximum power level
completionDelegateCode to execute after power is changed

◆ GetBatteryInfo()

void UGrokItApi.UgiInventory.GetBatteryInfo ( Action< Ugi.BatteryInfo completion)
inline

Get battery level while scanning

Parameters
completionCode to execute with battery information

Property Documentation

◆ Delegate

IUgiInventoryDelegate UGrokItApi.UgiInventory.Delegate
getset

Gets or sets the inventory delegate.

The delegate.

◆ Configuration

UgiRfidConfiguration UGrokItApi.UgiInventory.Configuration
get

The configuration used for this inventory

The rfid configuration.

◆ StartTime

DateTime UGrokItApi.UgiInventory.StartTime
get

When this inventory started (local time, to be consistent with DateTime.Now)

The start time.

◆ Tags

List<UgiTag> UGrokItApi.UgiInventory.Tags
get

Get all the tags found in this inventory

The tags.

◆ IsPaused

bool UGrokItApi.UgiInventory.IsPaused
get

Is inventory paused?

true if paused

◆ IsScanning

bool UGrokItApi.UgiInventory.IsScanning
get

Is the Grokker actively scanning?

true if scanning

◆ NumInventoryRounds

int UGrokItApi.UgiInventory.NumInventoryRounds
get

Get the number of inventory rounds that the Grokker has run in this inventory

The number of inventory rounds.

Enumeration Documentation

◆ InventoryResults

Inventory results, passed to InventoryDidStop

Enumerator
Ok 

Inventory completed normally

ErrorSending 

Error sending inventory command to reader

LostConnection 

Lost connection

BatteryTooLow 

Battery level is too low to run inventory

TemperatureTooHigh 

Grokker temperature is too high. This should only happen in a very hot environment

NotProvisioned 

Grokker is not provisioned. This should never happen

RegionNotSet 

The region (of the world) has not been set

◆ TagAccessReturnValues

Return values from ProgramTag, WriteTag, LockUnlockTag and ReadTag

Enumerator
Ok 

Access was successful

WrongPassword 

Incorrect password passed

PasswordRequired 

No password passed, but a password is required

MemoryOverrun 

Read/write to a memory locaion that does not exist on tht tag

TagNotFound 

Tag was not found

GeneralError 

General error

InventoryStopped 

Inventory Stopped

RequiresAuthentication 

Grokker must be authenticated


Class Documentation

◆ UGrokItApi::UgiInventory::LockUnlockMaskAndAction

class UGrokItApi::UgiInventory::LockUnlockMaskAndAction
Class Members
const int KILL_PASSWORD_MASK_BIT_OFFSET Offset for mask bits for kill password.
const int ACCESS_PASSWORD_MASK_BIT_OFFSET Offset for mask bits for access password
const int EPC_MASK_BIT_OFFSET Offset for mask bits for EPC memory bank
const int TID_MASK_BIT_OFFSET Offset for mask bits for TID memory bank
const int USER_MASK_BIT_OFFSET Offset for mask bits for USER memory bank
const int KILL_PASSWORD_ACTION_BIT_OFFSET Offset for action bits for kill password
const int ACCESS_PASSWORD_ACTION_BIT_OFFSET Offset for action bits for access password
const int EPC_ACTION_BIT_OFFSET Offset for action bits for EPC memory bank
const int TID_ACTION_BIT_OFFSET Offset for action bits for TID memory bank
const int USER_ACTION_BIT_OFFSET Offset for action bits for USER memory bank
const int MASK_CHANGE_NONE Mask: don't change
const int MASK_CHANGE_PERMALOCK Mask: change permlock bit
const int MASK_CHANGE_WRITABLE change writable bit
const int MASK_CHANGE_WRITABLE_AND_PERMALOCK Mask: change permlock and writable bits
const int ACTION_WRITABLE Action: writable
const int ACTION_PERMANENTLY_WRITABLE Action: permanently writable
const int ACTION_WRITE_RESTRICTED Action: write restricted (password required)
const int ACTION_PERMANENTLY_NOT_WRITABLE Action: permanently not writable

Member Data Documentation

◆ NO_PASSWORD

const int UGrokItApi.UgiInventory.NO_PASSWORD = 0

Default password, meaning the tag is not password protected