RFID_STATUS WINAPI RFID_Read ( RFID_HANDLE32  readerHandle,
UINT8 *  pTagID,
UINT32  tagIDLength,
LPREAD_ACCESS_PARAMS  lpReadAccessParams,
LPACCESS_FILTER  lpAccessFilter,
LPANTENNA_INFO  lpAntennaInfo,
LPTAG_DATA  lpTagData,
LPVOID  rsvd 
)

This function reads a specified memory bank of tag(s).

Parameters:
[in] readerHandle 
Handle to the RFID device
[in] pTagID 
Access-Operation will be performed on Tag with mentioned TagID. If this is NULL, lpAccessFilter will be considered as Filter Criteria for the Access operation.
[in] tagIDLength 
Tag Length(Ignored if pTagID is NULL)
[in] lpReadAccessParams 
Pointer to READ_ACCESS_PARAMS
[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.
[out] lpTagData 
Returns the Tag that was read if the API was called with a valid pTagID. If pTagID is NULL, tags reported from Reader can be fetched using RFID_GetReadTag or RFID_GetEventData optionally waiting for by waiting for the TAG_READ_EVENT.
[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 Parameter is invalid
  • RFID_API_COMMAND_TIMEOUT Timeout and no responses from the reader
  • RFID_COMM_NO_CONNECTION No Connection exists to the Host
  • RFID_INVENTORY_IN_PROGRESS Inventory in progress, cannot perform requested operation
  • RFID_ACCESS_IN_PROGRESS Access Operation in progress, cannot perform requested operation
  • RFID_ACCESS_TAG_READ_FAILED Tag Read failed
Remarks:
This function behaves synchronously when performing operation on single Tag i.e When specifying pTagID, the function waits for the operation to complete and returns with the result of the operation. If pTagID is NULL, the function behaves asynchronously and will return immediately. The completion of the operation will be signaled using ACCESS_STOP_EVENT, after which RFID_GetLastAccessResult can be called to know the result of the operation.
See also:
RFID_Write, RFID_Kill, RFID_Lock, RFID_GetReadTag RFID_BlockWrite, RFID_BlockErase, RFID_GetLastAccessResult
Remarks:
Example:
//Sample Code that prints TagID and Memory Bank
void printTagMemoryBankData(UINT8* pTagIDData, UINT32 tagIDLength,
UINT8* pMBData, UINT32 mbLength, char* memoryBankInfo)
{
char  MBBuffer[MAX_PATH] = {0, };
char  tagIDBuffer[MAX_PATH] = {0, };
char* pTagReportData = NULL;

pTagReportData = tagIDBuffer;
for(UINT32 index = 0; index < tagIDLength; index++)
{
if(0 < index && index%2 == 0)
{
*pTagReportData++ = '-';
}

sprintf(pTagReportData, "%02X", pTagIDData[index]);
while(*pTagReportData) pTagReportData++;
}

pTagReportData = MBBuffer;
for(UINT32 index = 0; index < mbLength; index++)
{
if(0 < index && index%2 == 0)
{
*pTagReportData++ = '-';
}
sprintf(pTagReportData, "%02X", pMBData[index]);
while(*pTagReportData) pTagReportData++;
}

if (tagIDLength && mbLength)
{
printf("\n Tag ID: %s :\n %s: %s\n", tagIDBuffer, memoryBankInfo, MBBuffer);
}
}
// Code snippet for Read Access operation on multiple tags
RFID_HANDLE32 readerHandle;
RFID_STATUS rfidStatus = RFID_API_SUCCESS;
READ_ACCESS_PARAMS readAccessParams;
LPTAG_DATA pTagData;
UINT32 accessSuccessCount, accessFailureCount;

if(RFID_API_SUCCESS == RFID_Connect(&readerHandle, TEXT("157.235.207.190"), 0, 0, 0))
{
HANDLE accessComplete = CreateEvent(NULL, FALSE, FALSE, NULL);
pTagData = RFID_AllocateTag(readerHandle);
if(NULL == pTagData)
{
printf("\n Tag Allocation failed");
}
else
{       
RFID_RegisterEventNotification(readerHandle, ACCESS_STOP_EVENT, accessComplete);
// Read User-Bank of multiple tags
readAccessParams.accessPassword = 0;
readAccessParams.memoryBank = MEMORY_BANK_USER;
readAccessParams.byteCount = 64;
readAccessParams.byteOffset = 0;
readAccessParams.accessPassword = 0;

rfidStatus = RFID_Read(readerHandle, NULL, 0, &readAccessParams, NULL, NULL, NULL, NULL);
if(RFID_API_SUCCESS != rfidStatus)
{
ERROR_INFO errorInfo;
RFID_GetLastErrorInfo(readerHandle, &errorInfo);
printf("\n Read Failed: %S", errorInfo.vendorMessage);
}
WaitForSingleObject(accessComplete, INFINITE);
accessSuccessCount = accessFailureCount = 0;
rfidStatus =  RFID_GetLastAccessResult(readerHandle,
&accessSuccessCount, &accessFailureCount);
printf("\n\n Reading User memory: Success = %d, Failed = %d", accessSuccessCount,
accessFailureCount);
// Fetch the tags
while(RFID_API_SUCCESS == RFID_GetReadTag(readerHandle, pTagData))
{
// Lets print the Tag ID and Memory Bank
printTagMemoryBankData(pTagData->pTagID, pTagData->tagIDLength,
pTagData->pMemoryBankData, pTagData->memoryBankDataLength, "User Memory");
}
}
rfidStatus = RFID_Disconnect(readerHandle);
CloseHandle(accessComplete);
}


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