Public Member Functions | Classes | Static Public Attributes
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< UgiTag > | getTags ()
| 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

  epc | EPC 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

  delegate | Delegate to set

## ◆ stopInventory()

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

Stop running inventory with a completion.

Parameters

  completion | code 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

  newDelegate | new 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

  configuration | new 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

  newDelegate | new inventory delegate (or null to use existing delegate)
  configuration | new 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

  oldEpc | EPC of tag to change
  newEpc | EPC to write to the tag
  password | Password to use (NO_PASSWORD for not password protected)
  completion | Completion code after tag is programmed

Exceptions

  IllegalArgumentException | if 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

  epc | EPC of tag to write to
  memoryBank | Memory bank to write to
  offset | Byte offset to write at (must be a multiple of 2)
  data | Data to write
  previousData | Previous value for this data (null if unknown or not available)
  password | Password to use (NO_PASSWORD for not password protected)
  completion | Completion 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

  epc | EPC of tag to set the password for
  currentPassword | Current password (UGI_NO_PASSWORD if not password protected)
  newPassword | Password to set (UGI_NO_PASSWORD for not password protected)
  completion | Completion 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

  epc | EPC of tag to set the password for
  currentPassword | Current password (UGI_NO_PASSWORD if not password protected)
  killPassword | Password to set (UGI_NO_PASSWORD for not password protected)
  completion | Completion 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

  epc | EPC of tag to lock/unlock
  maskAndAction | Description for which protection bits to change and what to change them to (UgiLockUnlockMaskAndAction)
  password | Password to use (NO_PASSWORD for not password protected)
  completion | Completion code after tag is locked/unlocked

## ◆ killTag()

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

Kill a tag.

Parameters

  epc | EPC of tag to kill
  password | Kill password
  completion | Completion 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

  epc | EPC of tag to read
  memoryBank | Memory bank to read
  offset | Byte offset to read at (must be a multiple of 2)
  minNumBytes | Minimum number of bytes to read (must be a multiple of 2)
  maxNumBytes | Maximum number of bytes to read (must be a multiple of 2)
  password | Password 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
  completion | Completion 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

  epc | EPC of tag to read
  command | Command bytes to send
  commandBits | Number of command bits to send
  responseBitLengthNoHeaderBit | Number of response bits to expect, if header bit is not set in the response
  responseBitLengthWithHeaderBit | Number of response bits to expect, if header bit is set in the response (if 0 then do not expect a header bit at all)
  receiveTimeoutUsec | Response timeout in uSec (some tags require more than the standard for custom commands)
  completion | Completion 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

  initialPowerLevel | Initial power level
  minPowerLevel | Minimum power level
  maxPowerLevel | Maximum power level
  completion | Completion 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

  completion | Completion code called with battery information