We are building a prototype application that reads an NFC tag using Android. However, we are not using the embedded NFC reader and Android SDK since we are using an external bluetooth reader called an ACR1255U-J1
The NFC chips that we are using are Mifare Desfire EV1 8k with v0.4 command set. I think these are known as wrapped APDU commands because I don't think the EV1 v0.4 supports the full ISO APDU command set.
Since we are using the external Bluetooth reader (it's a business requirement) we don't believe that we are able to use the Android NFC SDK and instead need to use the SDK provided by the bluetooth reader manufacturer.
Anyway, currently to read a payload of 8k it is taking upwards of 25 seconds. We suspect, although haven't formally verified yet, that in part this is due to the way we read data by:
- Issuing a read binary data command
- Blocking waiting for a callback that gives us the data
- Evaluate the response code that tells us whether there are more frames to read.
- If no more then we are done, otherwise continue to read.
Each frame size is a maximum of 59 bytes so as we understand it even if we request to read a bigger payload such as 100k or the entire 8k in one read command we would still only get 59 bytes of data back in one response frame.
This causes us to do 131 individual read commands that each then block and wait for data before piecing together each 59 bytes segment to get the payload.
Since the commands are going from the android app, to the bluetooth reader then over to the NFC card then the bytes back from the card and via the bluetooth reader over to the app 131 times we wonder if this is the bulk of the time being spent.
We are trying to find better ways to profile/debug the issue. Clearly it is possible to read faster since the onboard NFC reader using the Android NFC API is capable of reading the data in a few seconds.
Does anyone have any advice on what our issue could be or how we can speed this up.