Batch Mode

RFID SDK for Android 2.0.1.15

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();
    
  • Once getTags API call will result in tag data transfer followed by STOP event. STOP event is received once tag transfer is completed. Application can use the STOP event to trigger further logic like purging of tags as shown below.
  • 
    reader.Actions.purgeTags();
    
  • Once purge is completed application can finish the full cycle of reader connection. Now it can query settings/configuration, reader number/model etc. as required. Application should call following API

This section describes possible application behavior in handling the rfid reader with batch mode

SCEANARIO # 1

Application stops inventory

  1. Application reconnects with reader running in batch mode
  2. Clear internal count/list of inventoried tags
  3. User Stops operation
  4. Gets the batched tags
  5. Purge the tags
  6. Get/Set reader configurations

SCEANARIO # 2

Application needs to continue inventory

  1. Application reconnects with reader running in batch mode
  2. Clear internal count/list of inventoried tags (or ignore duplicate tag ids)
  3. Stop operation
  4. Gets the batched tags
  5. Purge the tags
  6. Get/Set reader configurations
  7. Start the inventory again
  8. 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