RFID_STATUS WINAPI RFID_NXPReadProtect ( RFID_HANDLE32  readerHandle,
UINT8 *  pTagID,
UINT32  tagIDLength,
LPNXP_READ_PROTECT_PARAMS  lpNXPReadProtectParams,
LPACCESS_FILTER  lpAccessFilter,
LPANTENNA_INFO  lpAntennaInfo,
LPVOID  rsvd 
)

This function sets the Quiet bit on one more NXP tags in the FOV. One can specify the Access filter-criteria on which this operation is to be performed. Also, the antenna Info on which this operation is to be performed may be specified.

Parameters:
[in] readerHandle 
Handle to the RFID device.
[in] pTagID 
Pointer to the byte array containing tagID
[in] tagIDLength 
Length of the byte array containing tagID
[in] lpNXPReadProtectParams 
Pointer to NXP_READ_PROTECT_PARAMS structure containing the Access-Password of the NXP tag(s)
[in] lpAccessFilter 
Pointer to Access filter structure specifying the tag-filter criteria for the current Access operation
[in] lpAntennaInfo 
Pointer to ANTENNA_INFO structure specifying the Antenna IDs on which the access operation is to be performed
[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 One of the parameters has taken an erroneous value
  • RFID_ACCESS_NXP_TAG_READ_PROTECT_FAILED Failed to set the Quiet bit on the specified tag

Remarks:
The API RFID_NXPReadProtect sets the Quiet bit on one or more NXP tags. As a result, these tags trace-back a string of zeroes during Inventory and don't respond to access-operations, there by preventing unsecure access to Tag information. To put them back into normal mode, one has to call RFID_NXPResetReadProtect API.
See also:
RFID_NXPResetReadProtect
Remarks:
Example:
// Code snippets to set Quiet bit on a single NXP tag and protect it from further access operations.
// ResetQuiet operation is also shown
{
   UINT8 NXPtagID[12] = {0x4e, 0x58, 0x50, 0x27, 0xb6, 0x8e, 0x3a, 0x00, 0x00, 0x00, 0x00, 0xc8};
   UINT8 NXPPasswordData[4] = {0x12, 0x34, 0x56, 0x78};
   UINT32 nSuccess = 0, nFailure = 0;
   RFID_HANDLE32 readerHandle;
   RFID_STATUS rfidStatus = RFID_API_SUCCESS;
   CONNECTION_INFO connectionInfo;
   connectionInfo.version = RFID_API3_5_1;
   if(RFID_API_SUCCESS == RFID_Connect(&readerHandle, TEXT("157.235.208.38"), 0, 0, &connectionInfo))
   { 
           // Write Access-password into NXP tag
           WRITE_ACCESS_PARAMS writeAccessParams;
           writeAccessParams.accessPassword = 0;
           writeAccessParams.pWriteData = NXPPasswordData;
           writeAccessParams.writeDataLength  = 4;
           writeAccessParams.memoryBank = MEMORY_BANK_RESERVED;
           writeAccessParams.byteOffset = 4;
           rfidStatus = RFID_Write(readerHandle, NXPtagID, 12, &writeAccessParams, NULL, NULL, NULL);
           if(rfidStatus == RFID_API_SUCCESS)
           {
                   NXP_READ_PROTECT_PARAMS readProtectParams;
                   readProtectParams.accessPassword = 0x12345678;
                   rfidStatus = RFID_NXPReadProtect(readerHandle, NXPtagID, 12, &readProtectParams, NULL, NULL, NULL);
                   if(rfidStatus == RFID_API_SUCCESS)
                   {
                           NXPPasswordData[3] = 87;
                           
                           rfidStatus = RFID_Write(readerHandle, NXPtagID, 12, &writeAccessParams, NULL, NULL, NULL);
                           // Access will fail on a quietened tag

                           NXP_RESET_READ_PROTECT_PARAMS resetReadProtectParams;
                       resetReadProtectParams.accessPassword = 0x12345678;
                       rfidStatus = RFID_NXPResetReadProtect(readerHandle, &resetReadProtectParams, NULL, NULL);
                                RFID_GetLastAccessResult(readerHandle, &nSuccess, &nFailure);
                           // nSuccess -> greater than equal to 1
              
                           rfidStatus = RFID_Write(readerHandle, NXPtagID, 12, &writeAccessParams, NULL, NULL, NULL);
                            // Access will now succeed        
                   }
           }
   }
   RFID_Disconnect(readerHandle);
}


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