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, 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,
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
com.ugrokit.api.UgiInventory.StopInventoryCompletion Interface Reference

Overview

Completion interface passed to stopInventory.

Public Member Functions

void exec ()
 Completion method.
 
com.ugrokit.api.UgiInventory.TagCustomCommandCompletion Interface Reference

Overview

Completion interface passed to readTag.

Public Member Functions

void exec (UgiTag tag, boolean headerBit, byte[] response, TagAccessReturnValues result)
 
Completion method More...
 

Member Function Documentation

◆ exec()

void com.ugrokit.api.UgiInventory.TagCustomCommandCompletion.exec ( UgiTag  tag,
boolean  headerBit,
byte []  response,
TagAccessReturnValues  result 
)


Completion method

Parameters
tagTag the custom command was done to
headerBitYES if the header bit was set in the response (usually used to indicate an error)
responseTag's response to the custom command
resultResult of the operation
com.ugrokit.api.UgiInventory.ChangePowerCompletion Interface Reference

Overview

Completion interface passed to changePower.

Public Member Functions

void exec (boolean success)
 
Completion method More...
 

Member Function Documentation

◆ exec()

void com.ugrokit.api.UgiInventory.ChangePowerCompletion.exec ( boolean  success)


Completion method

Parameters
successtrue if operation succeeded
com.ugrokit.api.UgiInventory.LockUnlockMaskAndAction Class Reference

Overview

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

Static Public Attributes

static final int KILL_PASSWORD_MASK_BIT_OFFSET = 18
 Offset for mask bits for kill password.
 
static final int ACCESS_PASSWORD_MASK_BIT_OFFSET = 16
 Offset for mask bits for access password.
 
static final int EPC_MASK_BIT_OFFSET = 14
 Offset for mask bits for EPC memory bank.
 
static final int TID_MASK_BIT_OFFSET = 12
 Offset for mask bits for TID memory bank.
 
static final int USER_MASK_BIT_OFFSET = 10
 Offset for mask bits for USER memory bank.
 
static final int KILL_PASSWORD_ACTION_BIT_OFFSET = 8
 Offset for action bits for kill password.
 
static final int ACCESS_PASSWORD_ACTION_BIT_OFFSET = 6
 Offset for action bits for access password.
 
static final int EPC_ACTION_BIT_OFFSET = 4
 Offset for action bits for EPC memory bank.
 
static final int TID_ACTION_BIT_OFFSET = 2
 Offset for action bits for TID memory bank.
 
static final int USER_ACTION_BIT_OFFSET = 0
 Offset for action bits for USER memory bank.
 
static final int MASK_CHANGE_NONE = 0
 Mask: don't change.
 
static final int MASK_CHANGE_PERMALOCK = 1
 Mask: change permlock bit.
 
static final int MASK_CHANGE_WRITABLE = 2
 Mask: change writable bit.
 
static final int MASK_CHANGE_WRITABLE_AND_PERMALOCK = 3
 Mask: change permlock and writable bits.
 
static final int ACTION_WRITABLE = 0
 Action: writable.
 
static final int ACTION_PERMANENTLY_WRITABLE = 1
 Action: permanently writable.
 
static final int ACTION_WRITE_RESTRICTED = 2
 Action: write restricted (password required)
 
static final int ACTION_PERMANENTLY_NOT_WRITABLE = 3
 Action: permanently not writable.
 
com.ugrokit.api.UgiInventory.TagAccessCompletion Interface Reference

Overview

Completion interface passed to writeTag and lockUnlockTag.

Public Member Functions

void exec (UgiTag tag, TagAccessReturnValues result)
 Completion method. More...
 

Member Function Documentation

◆ exec()

void com.ugrokit.api.UgiInventory.TagAccessCompletion.exec ( UgiTag  tag,
TagAccessReturnValues  result 
)

Completion method.

Parameters
tagTag accessed
resultResult of the access
com.ugrokit.api.UgiInventory.GetBatteryInfoCompletion Interface Reference

Overview

Completion interface passed to getBatteryInfo.

Public Member Functions

void exec (Ugi.BatteryInfo info)
 
Completion method More...
 

Member Function Documentation

◆ exec()

void com.ugrokit.api.UgiInventory.GetBatteryInfoCompletion.exec ( Ugi.BatteryInfo  info)


Completion method

Parameters
infoBattery information
com.ugrokit.api.UgiInventory.DetailedPerReadData Class Reference

Overview

Data for each tag read, sent if detailedPerReadData is YES in the RFID configuration.

Public Member Functions

Date getTimestamp ()
 Get when the find happened. More...
 
int getFrequency ()
 Get frequency the find happened at. More...
 
double getRssiI ()
 Get RSSI, I channel (0-15) More...
 
double getRssiQ ()
 Get RSSI, Q channel (0-15) More...
 
int getReadData1 ()
 Get read data. More...
 
int getReadData2 ()
 Get read data. More...
 
String toString ()
 Get a description of the tag, generally for debugging. More...
 

Member Function Documentation

◆ getTimestamp()

Date com.ugrokit.api.UgiInventory.DetailedPerReadData.getTimestamp ( )

Get when the find happened.

Returns
When the find happened

◆ getFrequency()

int com.ugrokit.api.UgiInventory.DetailedPerReadData.getFrequency ( )

Get frequency the find happened at.

Returns
frequency

◆ getRssiI()

double com.ugrokit.api.UgiInventory.DetailedPerReadData.getRssiI ( )

Get RSSI, I channel (0-15)

Returns
RSSI, I channel (0-15)

◆ getRssiQ()

double com.ugrokit.api.UgiInventory.DetailedPerReadData.getRssiQ ( )

Get RSSI, Q channel (0-15)

Returns
RSSI, Q channel (0-15)

◆ getReadData1()

int com.ugrokit.api.UgiInventory.DetailedPerReadData.getReadData1 ( )

Get read data.

Returns
Read data

◆ getReadData2()

int com.ugrokit.api.UgiInventory.DetailedPerReadData.getReadData2 ( )

Get read data.

Returns
Read data

◆ toString()

String com.ugrokit.api.UgiInventory.DetailedPerReadData.toString ( )

Get a description of the tag, generally for debugging.

Returns
string description
com.ugrokit.api.UgiInventory.TagAccessReturnValues Enum Reference

Overview

Return values from programTag, writeTag, lockUnlockTag and readTag.

Public Attributes

 OK
 Access was successful.
 
 WRONG_PASSWORD
 Incorrect password passed.
 
 PASSWORD_REQUIRED
 No password passed, but a password is required.
 
 MEMORY_OVERRUN
 Read/write to a memory locaion that does not exist on tht tag.
 
 TAG_NOT_FOUND
 Tag was not found.
 
 GENERAL_ERROR
 General error.
 
 INVENTORY_STOPPED
 Inventory stopped.
 
com.ugrokit.api.UgiInventory.TagReadCompletion Interface Reference

Overview

Completion interface passed to readTag.

Public Member Functions

void exec (@SuppressWarnings("unused") UgiTag tag, byte[] data, TagAccessReturnValues result)
 Completion method. More...
 

Member Function Documentation

◆ exec()

void com.ugrokit.api.UgiInventory.TagReadCompletion.exec ( @SuppressWarnings("unused") UgiTag  tag,
byte []  data,
TagAccessReturnValues  result 
)

Completion method.

Parameters
tagTag read
dataData read
resultResult of the read