Overview
This Tutorial provides a walk-through of the steps to use Impinj Gen2X tag features using RFID3 API including :
- Protected Mode
- TagFocus
- Tag Quieting
Create The Project
- Start by creating a new project in Android Studio. For help, see the Android Studio tutorial.
- Refer Hello RFID to prepare basic setup to work with RFID Reader and then follow this guide
Details
Impinj Gen2X is an enhancement to Gen2's radio and logical layers.
Impinj Gen2X tags are required to leverage these features with Gen2X-enabled Zebra RFID Readers.
Users should verify whether their tags support these operations by referring to Impinj Gen2X tag specifications: http://www.impinj.com/Gen2X
Setting it up
In the application create an object of ImpinjExtensions and pass connected RfidReader object to it. This will allow the application to use the following Impinj Gen2X APIs.
ImpinjExtensions impinjExtensions = new ImpinjExtensions(connectedRfidReader);
Protected Mode
Protected mode is a feature that renders a tag invisible to an RFID reader unless the reader first provides the correct 32-bit PIN/Password. A user can make the tag protected or unprotected using the following APIs.
By default, the password will be 0. Users can set the password by using writeWait operation.
TagData writeTagData = new TagData();
TagAccess tagAccess = new TagAccess();
TagAccess.WriteAccessParams writeAccessParams = tagAccess.new WriteAccessParams();
String writeData = password ;
writeAccessParams.setAccessPassword(Long.decode("00" ));
writeAccessParams.setMemoryBank(MEMORY_BANK.MEMORY_BANK_RESERVED);
writeAccessParams.setOffset(2);
writeAccessParams.setWriteData(writeData);
writeAccessParams.setWriteDataLength(2);
try {
connectedRfidReader.Actions.TagAccess.writeWait(tagId, writeAccessParams, null,writeTagData);
} catch (OperationFailureException | InvalidUsageException | IllegalStateException | NumberFormatException e) {
e.printStackTrace();
}
To get the password readWait can be used
TagData tagData = new TagData();
String password;
TagAccess tagAccess = new TagAccess();
TagAccess.ReadAccessParams readAccessParams = tagAccess.new ReadAccessParams();
readAccessParams.setAccessPassword(Long.decode("00" ));
readAccessParams.setCount(2);
readAccessParams.setMemoryBank(MEMORY_BANK.MEMORY_BANK_RESERVED);
readAccessParams.setOffset(2);
try {
tagData = (mConnectedRfidReader.Actions.TagAccess.readWait(tagId, readAccessParams, null));
if(tagData.getOpStatus() == ACCESS_OPERATION_STATUS.ACCESS_SUCCESS) {
password = tagData.getMemoryBankData();
}
} catch (OperationFailureException | InvalidUsageException | IllegalStateException | NumberFormatException e) {
e.printStackTrace();
}
Enable Impinj Protected Mode
String password = "ABCD5678"; // HEX value of 32 bit password
impinjExtensions.enableTagProtection(tagID, password, tagData);
Disable Impinj Protected Mode
impinjExtensions.disableTagProtection(tagID, password,tagData, antennaID);
Enable Inventory of Protected Tags (using known password).
String passoword = "ABCD5678"; // HEX value of 32 bit password
impinjExtensions.enableTagVisibility(password, antennaID);
Clear Protected Mode Configuration (reader will no longer read protected tags).
impinjExtensions.disableTagVisibility(password, antennaID);
TagFocus
TagFocus allows readers to silence already-inventoried tags to reduce redundant reads, allowing a reader to focus on weak tags that are typically the last to be found
Set the boolean value to true to enable tag focus mode and false to disable it. The SDK returns an IllegalStateException if you try to disable the tag focus filter when it was not set. Tag focus mode targets tags inventoried in SESSION S1.
impinjExtensions.setTagFocus(true, antennaID);
Set singulation.
Antennas.SingulationControl s1_singulationControl = mReader.Config.Antennas.getSingulationControl(antennaID);
s1_singulationControl.setSession(SESSION.SESSION_S1);
s1_singulationControl.Action.setInventoryState(INVENTORY_STATE.INVENTORY_STATE_A);
s1_singulationControl.Action.setSLFlag(SL_FLAG.SL_ALL);
mReader.Config.Antennas.setSingulationControl(antennaID, s1_singulationControl);
Tag Quieting
Tag quieting allows readers to silence already-inventoried tag subpopulations and thereby declutter complex enterprise tag environments. This technique is particularly suitable for applications that require reading the same tag multiple times as quickly as possible without the overhead of reading extraneous tags.
NOTE : When configuring pre-filters(including Tag quieting pre-filter), ensure that the total number does not exceed the maximum number of pre-filters supported by the device. Refer Pre-filter Configuration and 32 Pre-filter Configuration.
Tag quiet mask enums that are supported are:
- ENUM_TAGQUIET_MASK.S0A
- ENUM_TAGQUIET_MASK.S0B
- ENUM_TAGQUIET_MASK.S2A
- ENUM_TAGQUIET_MASK.S2B
- ENUM_TAGQUIET_MASK.S3A
- ENUM_TAGQUIET_MASK.S3B
- ENUM_TAGQUIET_MASK.SL_ASSERT
- ENUM_TAGQUIET_MASK.SL_DEASSERT
The user can provide up to three valid combinations. Providing more than three combinations or any invalid combination will result in the SDK throwing an IllegalArgumentException.
Examples of valid combinations:
-
ENUM_TAGQUIET_MASK[] tagMask_combination = { ENUM_TAGQUIET_MASK.S0B, ENUM_TAGQUIET_MASK.S2B, ENUM_TAGQUIET_MASK.S3B };
-
ENUM_TAGQUIET_MASK[] tagMask_combination = { ENUM_TAGQUIET_MASK.S2B, ENUM_TAGQUIET_MASK.SL_ASSERT };
-
ENUM_TAGQUIET_MASK[] tagMask_combination = { ENUM_TAGQUIET_MASK.S2B, ENUM_TAGQUIET_MASK.S3B };
For valid combination user cannot add enums with same session to ENUM_TAGQUIET_MASK array.
Examples of invalid combinations:
-
ENUM_TAGQUIET_MASK[] tagMask_combination = { ENUM_TAGQUIET_MASK.S0B, ENUM_TAGQUIET_MASK.S0A };
-
ENUM_TAGQUIET_MASK[] tagMask_combination = { ENUM_TAGQUIET_MASK.S0A, ENUM_TAGQUIET_MASK.S0A, ENUM_TAGQUIET_MASK.S3B };
-
ENUM_TAGQUIET_MASK[] tagMask_combination = { ENUM_TAGQUIET_MASK.SL_ASSERT, ENUM_TAGQUIET_MASK.SL_DEASSERT };
In addition to the ENUM_TAGQUIET_MASK array, the setTagQuiet API accepts TARGET and STATE_AWARE_ACTION as the second and third parameters, which can be set according to user requirements.
short antennaID = 1;
ENUM_TAGQUIET_MASK[] tagMask_combination = {
ENUM_TAGQUIET_MASK.S2B,
ENUM_TAGQUIET_MASK.S3B
};
TARGET target = TARGET.TARGET_INVENTORIED_STATE_S3;
STATE_AWARE_ACTION stateAwareAction = STATE_AWARE_ACTION.STATE_AWARE_ACTION_ASRT_SL_NOT_DSRT_SL;
impinjExtensions.setTagQuiet(tagMask_combination, target, stateAwareAction, antennaID);