RFID_STATUS WINAPI RFID_BlockPermalock ( RFID_HANDLE32  readerHandle,
UINT8 *  pTagID,
UINT32  tagIDLength,
LPBLOCK_PERMALOCK_ACCESS_PARAMS  lpBlkPermalockAccessParams,
LPACCESS_FILTER  lpAccessFilter,
LPANTENNA_INFO  lpAntennaInfo,
LPTAG_DATA  lpTagData,
LPVOID  rsvd 
)

This function allows to permalock multiple words in a Tag’s Reserved, EPC, TID, or User memory with a single command, or read the permalock satus of the memory blocks in a Tag's User memory.

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] lpBlkPermalockAccessParams 
Pointer to BLOCK_PERMALOCK_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 contained the permalock mask status if the function 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_BLOCK_PERMALOCK_FAILED Tag Block Permalock failed
  • RFID_READER_FUNCTION_UNSUPPORTED Function not supported by Reader
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 signalled using ACCESS_STOP_EVENT, after which RFID_GetLastAccessResult can be called to know the result of the operation.
See also:
RFID_Read, RFID_Write, RFID_Kill, RFID_Lock, RFID_BlockWrite, RFID_BlockErase, RFID_Recommission, RFID_GetLastAccessResult
Remarks:
Example:
// Code snippet for Read Access operation on multiple tags
RFID_HANDLE32 readerHandle;
RFID_STATUS rfidStatus = RFID_API_SUCCESS;
BLOCK_PERMALOCK_ACCESS_PARAMS blkPermalockAccessParams;
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
blkPermalockAccessParams.readLock = TRUE;
blkPermalockAccessParams.accessPassword = 0;
blkPermalockAccessParams.memoryBank = MEMORY_BANK_USER;
blkPermalockAccessParams.byteCount = 64;
blkPermalockAccessParams.byteOffset = 0;

rfidStatus = RFID_BlockPermalock(readerHandle, NULL, 0, &blkPermalockAccessParams, 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