How can I send an NDEF message from phone to MIFARE card reader?
On the reader side I use this code from https://github.com/AlterCodex/nxppy:
import nxppy
import ndef
# Instantiate reader
mifare = nxppy.Mifare()
# Select tag
uid = mifare.select()
# Read NDEF data
ndef_data = mifare.read_ndef()
# Parse NDEF data
ndef_records = list(ndef.message_decoder(ndef_data))
When I try to send an NDEF message with this code I get memory error:
public NdefMessage CreateNdefMessage(NfcEvent e)
{
NdefRecord uriRecord = NdefRecord.CreateUri("http://myURL");
NdefMessage message = new NdefMessage(new[] { uriRecord });
return message;
}
For this code I am getting error: ndef_data = milfare.read_ndef() MemoryError.
How can I edit this solution to make it work? I just want to read a simple NDEF message from Android application with nfc-explorer board but I am completly confused how to do this.