Overview
This guide provides details about batch mode handling using RFID API3
Details
Following describes different stages to working with RFD8500 reader when it is running in batch mode. Please refer RFID Demo application source code for reference
Configure batch mode
Use following APIs to configure the batch mode
reader.Config.setBatchMode(BATCH_MODE AUTO);
Note:Before starting inventory, it is required to purge the tag database on the reader so that reader will not report stale tags.
Connection in batch mode
Following event will be received when reader starts inventory in batch mode or connects with application when running in batch mode. Application captures the event and mark internal status that reader is running in batch mode.
if (rfidStatusEvents.StatusEventData.getStatusEventType() == STATUS_EVENT_TYPE.BATCH_MODE_EVENT)
{
isBatchModeInventoryRunning = true;
// get repeat trigger if it is configured on reader
isTriggerRepeat = rfidStatusEvents.StatusEventData.BatchModeEventData.get_RepeatTrigger();
runOnUiThread(new Runnable() {
@Override
public void run() {
// do something
}
});
}
Note: When bath mode operation is running on reader, all operation APIs will return error saying ‘Operation in progress’ so application should postpone further queries to reader until inventory operation is stopped.
Stop batch mode operation
Application can show the status that reader is running in batch mode. When user stops the inventory operation application should call stop API as shown below
try {
reader.Actions.Inventory.stop();
// add delay to stop event and abort completed
Thread.sleep(100);
// Update reader details
//UpdateReaderConnection();
// update fields before getting tags
//getTagReportingfields();
//
reader.Actions.getBatchedTags();
} catch (InvalidUsageException e) {
e.printStackTrace();
} catch (OperationFailureException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
Post STOP steps
- Once inventory is stopped and application has knowledge of operational batch mode then it can use getTags API to receive the batched tags.
reader.Actions.getBatchedTags();
reader.Actions.purgeTags();
This section describes possible application behavior in handling the rfid reader with batch mode
SCEANARIO # 1
Application stops inventory
- Application reconnects with reader running in batch mode
- Clear internal count/list of inventoried tags
- User Stops operation
- Gets the batched tags
- Purge the tags
- Get/Set reader configurations
SCEANARIO # 2
Application needs to continue inventory
- Application reconnects with reader running in batch mode
- Clear internal count/list of inventoried tags (or ignore duplicate tag ids)
- Stop operation
- Gets the batched tags
- Purge the tags
- Get/Set reader configurations
- Start the inventory again
- Application continues to display/updated tag counts
Notes:
- Application should be able to recognize same reader being connected
- Step#6 may not be required if application reconnecting with same reader in case of connection loss