RFID_STATUS WINAPI RFID_PerformInventory ( RFID_HANDLE32  readerHandle,
LPPOST_FILTER  lpPostFilter,
LPANTENNA_INFO  lpAntennaInfo,
LPTRIGGER_INFO  lpTriggerInfo,
LPVOID  rsvd 
)

This function performs the inventory operation.

Parameters:
[in] readerHandle 
Handle to the RFID device.
[in] lpPostFilter 
Filter Criteria for the inventory operation to be performed. If this is NULL, inventory operation will be based on the pre-filters, which if not set, the Reader's default filters will apply.
[in] lpAntennaInfo 
Antenna List on which the inventory operation is to be performed. If this is NULL, inventory is performed on ALL antennas.
[in] lpTriggerInfo 
Trigger Criteria for the inventory operation. If this is NULL, inventory starts right away when this API is called, and stops when RFID_StopInventory is called.
[in] rsvd Reserved for future use.
Returns:
If the function succeeds the return value is RFID_API_SUCCESS. If the function fails the return value is one of the following:
  • RFID_API_INVALID_HANDLE Handle provided is invalid
  • RFID_API_PARAM_ERROR Invalid parameter given
  • RFID_API_PARAM_OUT_OF_RANGE Parameter out of range [Antenna ID/GPI]
  • RFID_INVENTORY_IN_PROGRESS Inventory in progress, cannot perform requested operation
  • RFID_ACCESS_IN_PROGRESS Access Operation in progress, cannot perform requested operation
  • RFID_TAG_LOCATING_IN_PROGRESS Tag Locating in progress, cannot perform requested operation
  • RFID_NXP_EAS_SCAN_IN_PROGRESS NXP EAS SCAN in progress, cannot perform requested operation
Remarks:
Tags inventoried as a result of RFID_PerformInventory can be obtained using RFID_GetReadTag. The application can wait on the event registered for TAG_READ_EVENT before calling RFID_GetReadTag or RFID_GetEventData.
See also:
RFID_StopInventory, RFID_SetSingulationControl, RFID_AddPreFilter, RFID_DeletePreFilter,
Remarks:
Example:
//Sample Code that prints TagID and Memory Bank
void printTagData(UINT8*pTagID, UINT32 tagIDLength)
{
char  tagBuffer[64] = {0, };
char* pTagReportData = tagBuffer;
for(UINT32 index = 0; index < tagIDLength; index++)
{
if(0 < index && index%2 == 0)
{
*pTagReportData++ = '-';
}
sprintf(pTagReportData, "%02X", pTagID[index]);
while(*pTagReportData) pTagReportData++;
}
printf("\n Tag ID: %s", tagBuffer);
}
// Event Management and Simple Inventory, GPO
// Code snippet for Simple Inventory without filters
RFID_HANDLE32 readerHandle;
RFID_STATUS rfidStatus = RFID_API_SUCCESS;
HANDLE TagArrived = CreateEvent(NULL, FALSE, FALSE, NULL);
LPTAG_DATA pTagData;
TAG_STORAGE_SETTINGS tagStorageSettings;
BOOLEAN gpoState = FALSE;
if(RFID_API_SUCCESS == RFID_Connect(&readerHandle, TEXT("157.235.207.190"), 0, 0, 0))
{
// Optional step, Tag Storage Settings
tagStorageSettings.maxMemoryBankByteCount = 64;
tagStorageSettings.maxTagCount = 100;
tagStorageSettings.maxTagIDByteCount  = 12;
rfidStatus = RFID_SetTagStorageSettings(readerHandle, &tagStorageSettings);

// Register Event Handle for Managing events
rfidStatus = RFID_RegisterEventNotification(readerHandle, TAG_READ_EVENT, TagArrived);
pTagData = RFID_AllocateTag(readerHandle);
if(pTagData)
{
printf("\n\n Inventory:");
rfidStatus = RFID_PurgeTags(readerHandle, NULL);
// Simple Inventory which runs without any pre/post filters
// on All Antennas, and which runs till RFID_StopInventory is called
rfidStatus = RFID_PerformInventory(readerHandle, NULL, NULL, NULL, NULL);
// Lets wait for 3 seconds for the Inventory operation to fetch a tag
if(WaitForSingleObject(TagArrived, 3000) == WAIT_OBJECT_0)
{
// You can read Tag using RFID_GetEventData
rfidStatus = RFID_GetEventData(readerHandle, TAG_READ_EVENT, pTagData);
if(RFID_API_SUCCESS == rfidStatus)
printTagData(pTagData->pTagID, pTagData->tagIDLength);
}
rfidStatus = RFID_StopInventory(readerHandle);
// You can also read Tag using RFID_GetReadTag
while(RFID_API_SUCCESS == RFID_GetReadTag(readerHandle, pTagData))
{ 
// Say GPO port 1 is connected to an LED, lets blink the 
// Led when a tag is read
rfidStatus = RFID_SetGPOState(readerHandle, 1, TRUE);
printTagData(pTagData->pTagID, pTagData->tagIDLength);
}
if(RFID_API_SUCCESS == RFID_GetGPOState(readerHandle, 1, &gpoState))
{
// Disable the GPO now that inventory is over.
if(gpoState)
RFID_SetGPOState(readerHandle, 1, FALSE);
}
}
rfidStatus = RFID_DeregisterEventNotification(readerHandle, TAG_READ_EVENT);
rfidStatus = RFID_Disconnect(readerHandle);
}
CloseHandle(TagArrived);


Generated on Fri Mar 4 02:25:30 2016 for RFIDAPI3 1.1 C API Documentation by  doxygen 1.5.6