Overview
This Tutorial provides a walk-through of the steps to perform TagStorage Settings using RFID3 API
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
Applications can also choose to enable/disable reporting of certain fields in TAG_DATA. Disabling certain fields can sometimes improve the performance as the Reader shall not be processing that information. It can also result in specific behavior. For e.g. disabling reporting of Antenna Id can result in application receiving as single unique tag even though they were multiple entries of the same tag reported from different Antennas. The following snippet shows enabling the reporting of PeakRSSI, Tag Seen count, PC and CRC only and disabling other fields like Antenna ID, time stamps and XPC.
Setting it up
No specific setup is required.
Performing Operation
TagStorageSettings tagStorageSettings = reader.Config.getTagStorageSettings();
TAG_FIELD[] tagField = new TAG_FIELD[4];
tagField[0] = TAG_FIELD.PC;
tagField[1] = TAG_FIELD.PEAK_RSSI;
tagField[2] = TAG_FIELD.TAG_SEEN_COUNT;
tagField[3] = TAG_FIELD.CRC;
tagStorageSettings.setTagFields(tagField);
reader.Config.setTagStorageSettings(tagStorageSettings);
Grab the results
The result can be observed in tags reported in TagData.
//The response of the tag tagStorageSettings comes through eventReadNotify in the following Event Handler.
public class EventHandler implements RfidEventsListener {
// Read Event Notification
public void eventReadNotify(RfidReadEvents e) {
TagData[] myTags = reader.Actions.getReadTags(100);
if (myTags != null) {
for (int index = 0; index < myTags.length; index++) {
Log.d(TAG,"Tag ID " + myTags[index].getTagID());
Log.d(TAG,"Tag PC " + myTags[index].getPC());
}
}
}
}
Closer look
- API call
getReadTags
request to retrieve 100 tags from SDK's internal queue of tags, one can change this number as per tag reading speed or application processing speed
What's Next
setAttachTagDataWithReadEvent
to true and receive each tag data inRfidReadEvents