I am working with Mifare Ultralight C tags and write data in NDEF format to them. Am using NDEF-NFC library to create raw bytes for my NDEF message. My NDEF message is
var spRecord = new NdefTextRecord {
Text = "1",
LanguageCode = "en"
};
var msg = new NdefMessage { spRecord };
The output I get is D1 01 04 54 02 65 6E 31
(hexadecimal). If I write this byte array to the tag as-is:
- After reading from the tag and using the same NDEF-NFC library I am able to convert back to the desired NDEF message.
- Android applications do not recognize the NDEF message. I tried NFC Tools for Android.
Following the suggestions in Writing Ndef to NFC tag in Windows Form Application C# using ACR122U as Reader/Writer, I modified my byte array to write 03 08 D1 01 04 54 02 65 6E 31 FE 00
instead of the original byte array produced by the library.
Now I'm able to read the NDEF message using Android apps.
But on trying to convert the byte array to an NDEF message object using the library, I get the following error:
Ndef parse error: Expected Message Begin missing in first record.
How can I read back the NDEF message correctly?