Forum / MIFARE SDK / DESFire NDEF Write Exception with SDKLite
-
Hi,
I'm trying to write NDEF message to DESFire card but it throws exception.
Following is my code,
..connect
..authenticate
byte[] masterKey = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
NdefRecord textRecord = createTextRecord("123563", Locale.ENGLISH, true);
NdefMessage message = new NdefMessage(new NdefRecord[] { textRecord });
mDESFire.writeNdef(masterKey, message);
..close
Exception is following,
com.nxp.nfclib.exceptions.DESFireException: ISO invalidResponse: Wrong parameters P1 and/or P2 / Application not found / File not found.
Is this a limitation in lite version or i'm doing something wrong.
+ 0 | - 0
Hello,
Have you tried to personalize the card before you authenticate it?
The Exception indicates that there is no application created on your card. But since you need to provide an AppID, and AppKey in the authenticate phase - you have to personalize your card before that.
In personalization, provide the same AppID and AppKey as you do in your authenticate step. Then do authenticate. And everything else as you wrote.
BR,
David
+ 0 | - 0
Thanks David for your response.
I'm already doing authentication and personalize. Also, i'm able to successfully write bytes data using the public void write(byte[] data) method.
Above exception was only happening while using
public void writeNdef(byte[] masterKey, NdefMessage msg)
Anyways, we yesterday bought Advanced SDK. It's clearly different from the lite version. I hope we will not face this issue in Advanced version. :-)
Thanks.
Bilal
+ 0 | - 0
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.