I use the library in the docstore (Sw375622).
/* Card detected */
/* Get the tag types detected info */
status = phacDiscLoop_GetConfig(pDiscLoop, PHAC_DISCLOOP_CONFIG_TECH_DETECTED, &wTagsDetected);
/* Check for Status */
if ((status & PH_ERR_MASK) == PH_ERR_SUCCESS)
{
/* Check for Type A tag detection */
if (PHAC_DISCLOOP_CHECK_ANDMASK(wTagsDetected, PHAC_DISCLOOP_POS_BIT_MASK_A))
{
/* Check for MIFARE Classic */
DEBUG_PRINTF ("\nSAK: 0x%x",pDiscLoop->sTypeATargetInfo.aTypeA_I3P3[0].aSak);
if (0x20 == (pDiscLoop->sTypeATargetInfo.aTypeA_I3P3[0].aSak & 0x20))//if (0x08 == (pDiscLoop->sTypeATargetInfo.aTypeA_I3P3[0].aSak & 0x08))
{
DEBUG_PRINTF ("\nUID: ");
phApp_Print_Buff(pDiscLoop->sTypeATargetInfo.aTypeA_I3P3[0].aUid,pDiscLoop->sTypeATargetInfo.aTypeA_I3P3[0].bUidSize);
bFirstAuth = 1;
wBlockNo = 0x4000;
bLenDivInput = 0;
bLenPcdCap2 = 0;
status = phalMfp_AuthenticateSL3(psalMFP, bFirstAuth, wBlockNo, 1,0, bLenDivInput, pDivInput,0, pPcdCap2In, pPcdCap2Out, pPcdCap2);
CHECK_STATUS(status);
//TODO Read command
DEBUG_PRINTF("\nPlease Remove the Card\n\n");
/* Field RESET */
status = phhalHw_FieldReset(pHal);
CHECK_STATUS(status);
/* Make sure that example application is not detecting the same card continuously */
do
{
/* Send WakeUpA */
status = phpalI14443p3a_WakeUpA(pDiscLoop->pPal1443p3aDataParams,
pDiscLoop->sTypeATargetInfo.aTypeA_I3P3[0].aAtqa);
/* Check for Status */
if (status != PH_ERR_SUCCESS)
{
break; /* Card Removed, break from the loop */
}
/* Send HaltA */
status = phpalI14443p3a_HaltA(pDiscLoop->pPal1443p3aDataParams);
CHECK_STATUS(status);
/* Delay - 5 milli seconds*/
status = phhalHw_Wait(pDiscLoop->pHalDataParams, PHHAL_HW_TIME_MILLISECONDS, 5);
CHECK_STATUS(status);
}while(1);
}
}
}
Debug log
Reader chip RC660: 0x1a
Ready to detect
SAK: 0x20
UID: 04 2E 6D 5A 6C 5C 80
Error - (0x0201) has occurred : 0xCCEE CC-Component ID, EE-Error code. Refer-ph_Status.h
Please Remove the Card
I found the following that I am not getting a response from the card:
wOption = 8000
pTxBuffer = 70004000
status = 0 (PH_ERR_SUCCESS)
But next:
wOption = 4000
pTxBuffer = 0
status = 0x0201 (PH_ERR_IO_TIMEOUT)
In other words, I don't get the RndB number from the card