Hi,
I'm working on an app that uses Host Card Emulation to send data to a Adafruit NFC shield. The app receives the SELECT AID apdu and then returns a 32 bytes md5 hash to be used by the Arduino.
My problem is it seems the response apdu's last 9 characters get changed to "ÿ" (255).
I've already tested the outgoing apdu on the app side and all the characters are there so I'm assuming something is happening on the arduino side of things.
Here is the relevant part of my sketch:
uint8_t response[32];
uint8_t responseLength = sizeof(response);
if (nfc.inDataExchange(message, sizeof(message), response, &responseLength)) {
Serial.print("TYPECASTED RAW: ");
for (int i = 0; i < sizeof(response); i++) {
Serial.print((char)response[i]);
}
Serial.println(" ");
unlockDrawer(message);
}
And the serial output from that is:
TYPECASTED RAW: e68d3f574009cbbe0111502ÿÿÿÿÿÿÿÿÿ
Any help appreciated. Thank you.
UPDATE
Went into the Adafruit NFC library and enabled debug mode and I get
'Status code indicates an error'
If that points anyone in the right direction...