NXP NFC Reader Library ATS bytes bug

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NXP NFC Reader Library ATS bytes bug

1,244 Views
troky
Contributor II

Hi,

I found possible bug in phpalI14443p4a_Sw_Rats() function where *pAts param is not initialized/zeroed.

*pAts is user supplied buffer and can be zeroed in user code before calling discloop routine but I see this as workaround.

For example, if I read Mifare Plus card (that respondes to RATS command) and after that I read Mifare Classic card (no RATS response) I still got ATS bytes set from prior Mifare Plus card and detect Classic card as Plus card since both have SAK=0x08.

ATS buffer should be zeroed before issuing RATS command.

 

troky

Labels (1)
0 Kudos
Reply
3 Replies

1,227 Views
troky
Contributor II

Yes, it is always PH_ERR_SUCCESS. RATS is internal part of "discloop".

IMHO, this buffer (big enough) should be part of struct sTypeA_I3P4 so it can be cleared in library. What is the reason user has to supply ATS buffer (pointer) to library?

Also, it would be nice feature to have "bool bHasAts" in  "struct sTypeA_I3P4" or some other mechanism to check for valid ATS response.

 

troky

 

0 Kudos
Reply

1,222 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @troky ,

 

A good example for reference regarding this kind of operation is the demo of "Nfcrdlib_ISO10373_6_PCD_ComplApp", in which an array is defined globally for this purpose.

Kan_Li_0-1630573335977.png

 

You may fetch the latest version (should be 6.12.00) of "NFC reader library" for more details. 

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

1,231 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @troky ,

 

Yes, providing an empty buffer to this kind of function is always a good habit! Have you also checked the returned value from this function in case of reading a mifare classic card? Is it always "PH_ERR_SUCCESS"? 

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply