com.ugrokit.api.UgiInventory Class Reference

Overview

An inventory session.

Public Member Functions

UgiInventoryDelegate getDelegate ()
 Get the inventory delegate. More...
 
UgiRfidConfiguration getRfidConfiguration ()
 Get the configuration used for this inventory. More...
 
Date getStartTime ()
 Get the time the inventory started. More...
 
UgiTag getTagByEpc (UgiEpc epc)
 Get information for an EPC. More...
 
List< UgiTaggetTags ()
 Get the array of tags that have been found. More...
 
boolean isPaused ()
 Is inventory paused. More...
 
boolean isScanning ()
 Is the Grokker actively scanning. More...
 
int getNumInventoryRounds ()
 Get the number of inventory rounds that the Grokker has run in this inventory. More...
 
void setDelegate (UgiInventoryDelegate delegate)
 Set the inventory delegate. More...
 
void stopInventory (StopInventoryCompletion completion)
 Stop running inventory with a completion. More...
 
void stopInventory ()
 Stop running inventory.
 
void pauseInventory ()
 Stop running inventory temporarily (such as while a dialog box is displayed)
 
void resumeInventory ()
 Restart inventory after a temporarily stop.
 
void resumeInventory (UgiInventoryDelegate newDelegate)
 Restart inventory after a temporarily stop, with a new delegate to send notifications to. More...
 
void resumeInventory (UgiRfidConfiguration configuration)
 Restart inventory after a temporarily stop. More...
 
void resumeInventory (UgiInventoryDelegate newDelegate, UgiRfidConfiguration configuration)
 Restart inventory after a temporarily stop. More...
 
void programTag (UgiEpc oldEpc, UgiEpc newEpc, int password, TagAccessCompletion completion)
 Program a tag. More...
 
void writeTag (UgiEpc epc, UgiRfidConfiguration.MemoryBank memoryBank, int offset, byte[] data, byte[] previousData, int password, TagAccessCompletion completion)
 Write memory. More...
 
void setTagAccessPassword (UgiEpc epc, int currentPassword, int newPassword, TagAccessCompletion completion)
 Set a tag's access password. More...
 
void setTagKillPassword (UgiEpc epc, int currentPassword, int killPassword, TagAccessCompletion completion)
 Set a tag's kill password. More...
 
void lockUnlockTag (UgiEpc epc, int maskAndAction, int password, TagAccessCompletion completion)
 Lock/unlock a tag. More...
 
void killTag (UgiEpc epc, int password, TagAccessCompletion completion)
 Kill a tag. More...
 
void readTag (UgiEpc epc, UgiRfidConfiguration.MemoryBank memoryBank, int offset, int minNumBytes, int maxNumBytes, int password, final TagReadCompletion completion)
 Read a tag's memory. More...
 
void customCommandToTag (UgiEpc epc, byte[] command, int commandBits, int responseBitLengthNoHeaderBit, int responseBitLengthWithHeaderBit, int receiveTimeoutUsec, TagCustomCommandCompletion completion)
 Do a custom command to a tag. More...
 
void changePower (double initialPowerLevel, double minPowerLevel, double maxPowerLevel, ChangePowerCompletion completion)
 Change power. More...
 
void getBatteryInfo (GetBatteryInfoCompletion completion)
 Get battery level while scanning. More...
 

Classes

interface  ChangePowerCompletion
 Completion interface passed to changePower. More...
 
class  DetailedPerReadData
 Data for each tag read, sent if detailedPerReadData is YES in the RFID configuration. More...
 
interface  GetBatteryInfoCompletion
 Completion interface passed to getBatteryInfo. More...
 
class  LockUnlockMaskAndAction
 Definitions for value passed to lockUnlockTag choosing what banks to change the locked status for and what to change them to. More...
 
interface  StopInventoryCompletion
 Completion interface passed to stopInventory. More...
 
interface  TagAccessCompletion
 Completion interface passed to writeTag and lockUnlockTag. More...
 
enum  TagAccessReturnValues
 Return values from programTag, writeTag, lockUnlockTag and readTag. More...
 
interface  TagCustomCommandCompletion
 Completion interface passed to readTag. More...
 
interface  TagReadCompletion
 Completion interface passed to readTag. More...
 

Static Public Attributes

static final int NO_PASSWORD = 0
 Default password, meaning the tag is not password protected.
 

Member Function Documentation

◆ getDelegate()

UgiInventoryDelegate com.ugrokit.api.UgiInventory.getDelegate ( )

Get the inventory delegate.

Returns
Inventory delegate

◆ getRfidConfiguration()

UgiRfidConfiguration com.ugrokit.api.UgiInventory.getRfidConfiguration ( )

Get the configuration used for this inventory.

Returns
UgiRfidConfiguration used for this inventory

◆ getStartTime()

Date com.ugrokit.api.UgiInventory.getStartTime ( )

Get the time the inventory started.

Returns
the time the inventory started

◆ getTagByEpc()

UgiTag com.ugrokit.api.UgiInventory.getTagByEpc ( UgiEpc  epc)

Get information for an EPC.

Parameters
epcEPC to find
Returns
UgiTag object if the tag has been found, nil if the tag has not been found

◆ getTags()

List<UgiTag> com.ugrokit.api.UgiInventory.getTags ( )

Get the array of tags that have been found.

Returns
Array of tags that have been found

◆ isPaused()

boolean com.ugrokit.api.UgiInventory.isPaused ( )

Is inventory paused.

Returns
true if inventory is paused

◆ isScanning()

boolean com.ugrokit.api.UgiInventory.isScanning ( )

Is the Grokker actively scanning.

Returns
true if Grokker is scanning

◆ getNumInventoryRounds()

int com.ugrokit.api.UgiInventory.getNumInventoryRounds ( )

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

Returns
The number of inventory rounds that the Grokker has run in this inventory

◆ setDelegate()

void com.ugrokit.api.UgiInventory.setDelegate ( UgiInventoryDelegate  delegate)

Set the inventory delegate.

Parameters
delegateDelegate to set

◆ stopInventory()

void com.ugrokit.api.UgiInventory.stopInventory ( StopInventoryCompletion  completion)

Stop running inventory with a completion.

Parameters
completioncode to run after inventory is stopped

◆ resumeInventory() [1/3]

void com.ugrokit.api.UgiInventory.resumeInventory ( UgiInventoryDelegate  newDelegate)

Restart inventory after a temporarily stop, with a new delegate to send notifications to.

Parameters
newDelegatenew inventory delegate (or null to use existing delegate)

◆ resumeInventory() [2/3]

void com.ugrokit.api.UgiInventory.resumeInventory ( UgiRfidConfiguration  configuration)

Restart inventory after a temporarily stop.

Parameters
configurationnew configuration (or null to use existing configuration)

◆ resumeInventory() [3/3]

void com.ugrokit.api.UgiInventory.resumeInventory ( UgiInventoryDelegate  newDelegate,
UgiRfidConfiguration  configuration 
)

Restart inventory after a temporarily stop.

Parameters
newDelegatenew inventory delegate (or null to use existing delegate)
configurationnew configuration (or null to use existing configuration)

◆ programTag()

void com.ugrokit.api.UgiInventory.programTag ( UgiEpc  oldEpc,
UgiEpc  newEpc,
int  password,
TagAccessCompletion  completion 
)

Program 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)
completionCompletion code after tag is programmed
Exceptions
IllegalArgumentExceptionif the byte length of newEpc and oldEpc differ.

◆ writeTag()

void com.ugrokit.api.UgiInventory.writeTag ( UgiEpc  epc,
UgiRfidConfiguration.MemoryBank  memoryBank,
int  offset,
byte []  data,
byte []  previousData,
int  password,
TagAccessCompletion  completion 
)

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)
completionCompletion code after tag is programmed

◆ setTagAccessPassword()

void com.ugrokit.api.UgiInventory.setTagAccessPassword ( UgiEpc  epc,
int  currentPassword,
int  newPassword,
TagAccessCompletion  completion 
)

Set a 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)
completionCompletion code after pasword is set

◆ setTagKillPassword()

void com.ugrokit.api.UgiInventory.setTagKillPassword ( UgiEpc  epc,
int  currentPassword,
int  killPassword,
TagAccessCompletion  completion 
)

Set a tag's kill password.

Parameters
epcEPC of tag to set the password for
currentPasswordCurrent password (UGI_NO_PASSWORD if not password protected)
killPasswordPassword to set (UGI_NO_PASSWORD for not password protected)
completionCompletion code after password is set

◆ lockUnlockTag()

void com.ugrokit.api.UgiInventory.lockUnlockTag ( UgiEpc  epc,
int  maskAndAction,
int  password,
TagAccessCompletion  completion 
)

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)
completionCompletion code after tag is locked/unlocked

◆ killTag()

void com.ugrokit.api.UgiInventory.killTag ( UgiEpc  epc,
int  password,
TagAccessCompletion  completion 
)

Kill a tag.

Parameters
epcEPC of tag to kill
passwordKill password
completionCompletion code after tag is killed

◆ readTag()

void com.ugrokit.api.UgiInventory.readTag ( UgiEpc  epc,
UgiRfidConfiguration.MemoryBank  memoryBank,
int  offset,
int  minNumBytes,
int  maxNumBytes,
int  password,
final TagReadCompletion  completion 
)

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 (UGI_NO_PASSWORD for not password protected), only relavant for the ACESS and KILL passwords. Password is only supported in Grokkers with firmware 1.12.2 and above
completionCompletion code after tag is read

◆ customCommandToTag()

void com.ugrokit.api.UgiInventory.customCommandToTag ( UgiEpc  epc,
byte []  command,
int  commandBits,
int  responseBitLengthNoHeaderBit,
int  responseBitLengthWithHeaderBit,
int  receiveTimeoutUsec,
TagCustomCommandCompletion  completion 
)

Do a custom command to a tag.

Parameters
epcEPC of tag to read
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)
completionCompletion code after the custom command is executed

◆ changePower()

void com.ugrokit.api.UgiInventory.changePower ( double  initialPowerLevel,
double  minPowerLevel,
double  maxPowerLevel,
ChangePowerCompletion  completion 
)

Change power.

Parameters
initialPowerLevelInitial power level
minPowerLevelMinimum power level
maxPowerLevelMaximum power level
completionCompletion code after the power is changed

◆ getBatteryInfo()

void com.ugrokit.api.UgiInventory.getBatteryInfo ( GetBatteryInfoCompletion  completion)

Get battery level while scanning.

This causing inventory to pause for a short period of time.

Parameters
completionCompletion code called with battery information