NXP NFC Reader Library ATS bytes bug

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

NXP NFC Reader Library ATS bytes bug

1,199件の閲覧回数
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

ラベル(1)
0 件の賞賛
返信
3 返答(返信)

1,182件の閲覧回数
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 件の賞賛
返信

1,177件の閲覧回数
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 件の賞賛
返信

1,186件の閲覧回数
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 件の賞賛
返信