RFID_STATUS WINAPI RFID_PerformAccessSequence ( RFID_HANDLE32  readerHandle,
LPACCESS_FILTER  lpAccessFilter,
LPANTENNA_INFO  lpAntennaInfo,
LPTRIGGER_INFO  lpTriggerInfo,
LPVOID  rsvd 
)

This function performs the access operations as specified by Access Operation sequence API.

Parameters:
[in] readerHandle 
Handle to the RFID device.
[in] lpAccessFilter 
Filter Criteria for the Access operation. If this is NULL, there wont be any access filters used for the operation.
[in] lpAntennaInfo 
Antenna List on which the access operation is to be performed. If this is NULL, access is performed on ALL antennas.
[in] lpTriggerInfo 
Trigger Criteria for the access operation. If this is NULL, access starts right away when this API is called, and stop when RFID_StopAccessSequence 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_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:
When the start-trigger criteria is met, the event ACCESS_START_EVENT is signalled. Basic Tag-Access can be performed using RFID_xxxx functions to operate on a single-tag or multiple tags instantly i.e. without any explicit triggers.
See also:
RFID_InitializeAccessSequence, RFID_DeinitializeAccessSequence RFID_AddOperationToAccessSequence, RFID_DeleteOperationFromAccessSequence, RFID_StopAccessSequence, RFID_GetLastAccessResult
Remarks:
Example:
// Example that adds 3 Read operations to the Access-Sequence
RFID_HANDLE32 readerHandle;
RFID_STATUS rfidStatus = RFID_API_SUCCESS;
READ_ACCESS_PARAMS readAccessParams;
LPTAG_DATA pTagData;
UINT32 accessSuccessCount, accessFailureCount;
OP_CODE_PARAMS opCodeParams; 
UINT32 opCode;
TRIGGER_INFO triggerInfo;
HANDLE accessStopEventHandle = CreateEvent(NULL, FALSE, FALSE, NULL);

if(RFID_API_SUCCESS == RFID_Connect(&readerHandle, TEXT("157.235.207.190"), 0, 0, 0))
{
pTagData = RFID_AllocateTag(readerHandle);
if(NULL == pTagData)
{
printf("\n Tag Allocation failed");
}
else
{
rfidStatus = RFID_InitializeAccessSequence(readerHandle);

readAccessParams.byteCount = 4;
readAccessParams.byteOffset = 0;
readAccessParams.accessPassword = 0;
opCodeParams.opCode = ACCESS_OPERATION_READ;
opCodeParams.opParams = &readAccessParams;

// Add Operation to Read TID
readAccessParams.memoryBank = MEMORY_BANK_TID;
rfidStatus = RFID_AddOperationToAccessSequence(readerHandle, &opCodeParams, &opCode);

// Add Operation to Read User Memory
readAccessParams.memoryBank = MEMORY_BANK_USER;
rfidStatus = RFID_AddOperationToAccessSequence(readerHandle, &opCodeParams, &opCode);

// Add Operation to Read Reserved Memory
readAccessParams.memoryBank = MEMORY_BANK_RESERVED;
rfidStatus = RFID_AddOperationToAccessSequence(readerHandle, &opCodeParams, &opCode);

triggerInfo.startTrigger.type = START_TRIGGER_TYPE_IMMEDIATE;
triggerInfo.stopTrigger.type = STOP_TRIGGER_TYPE_N_ATTEMPTS_WITH_TIMEOUT;
triggerInfo.stopTrigger.value.numAttempts.n = 1; // One round of inventory
triggerInfo.stopTrigger.value.numAttempts.timeoutMilliseconds = 2000; // Max 2 seconds
triggerInfo.tagReportTrigger = 0; // Reader shall send reports when access operation is completed

RFID_RegisterEventNotification(readerHandle, ACCESS_STOP_EVENT, accessStopEventHandle);
if(RFID_API_SUCCESS == RFID_PerformAccessSequence(readerHandle,
NULL, NULL, &triggerInfo, NULL))
{

WaitForSingleObject(accessStopEventHandle, INFINITE);

rfidStatus =  RFID_GetLastAccessResult(readerHandle,
&accessSuccessCount, &accessFailureCount);
printf("\n\n Access Sequence: Success = %d, Failed = %d", accessSuccessCount,
accessFailureCount);
while(RFID_API_SUCCESS == RFID_GetReadTag(readerHandle, pTagData))
{
printTagMemoryBankData(pTagData->pTagID, pTagData->tagIDLength,
pTagData->pMemoryBankData, pTagData->memoryBankDataLength, "Bank");
}

}
// Delete All Operations from the Access Sequence
rfidStatus = RFID_DeleteOperationFromAccessSequence(readerHandle, 0);
rfidStatus = RFID_DeinitializeAccessSequence(readerHandle);
}
rfidStatus = RFID_Disconnect(readerHandle);
}
CloseHandle(accessStopEventHandle);


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