[PN7462AU] Is there an API to immediately check if a card(tag) has been removed?

cancel
Showing results for 
Search instead for 
Did you mean: 

[PN7462AU] Is there an API to immediately check if a card(tag) has been removed?

Jump to solution
160 Views
Contributor I

Good day,

I'm a engineer using PN7462AU. I am developing an NFC communication program. When I remove the card (tag), I want to recognize it and stop all communication.

Below is the setup details,

1. Hardware: PN7462AU
2. SDK: PN7462AU-FW_v05.21.00
3. IDE: MCUXpresso IDE v11.0.0

Question : Is there an API to immediately check if a card(tag) has been removed?

If anyone knows the answer to your question, please reply.

If you have any question, please feel free to contact me.

 

Thanks.

0 Kudos
1 Solution
70 Views
NXP TechSupport
NXP TechSupport

Hello,

I believe the following code available in NfcrdlibEx4_MIFAREClassic example of the NFC Reader Library may help you. It is basically an infinite loop checking for card presence (WakeUpA and HaltA commands are sent continuously).

 

Code (NfcrdlibEx4_MIFAREClassic.c -> starting at line 305):

 

                    /* 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);

 

 

Hope it helps!

BR,

Ivan.

View solution in original post

0 Kudos
2 Replies
70 Views
Contributor I

Dear Ivan,

Thank you for response my question. I tried the code, but it didn't work. I think it didn't work by my mistake. I will contact you again if you have any further questions. Thank you.

0 Kudos
71 Views
NXP TechSupport
NXP TechSupport

Hello,

I believe the following code available in NfcrdlibEx4_MIFAREClassic example of the NFC Reader Library may help you. It is basically an infinite loop checking for card presence (WakeUpA and HaltA commands are sent continuously).

 

Code (NfcrdlibEx4_MIFAREClassic.c -> starting at line 305):

 

                    /* 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);

 

 

Hope it helps!

BR,

Ivan.

View solution in original post

0 Kudos