title: NFC Tag Read Speed
body: <p>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 <a href="http://www.acs.com.hk/en/products/403/acr1255u-j1-bluetooth%C2%AE-nfc-reader/" rel="nofollow noreferrer">ACR1255U-J1</a> </p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>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:</p>
  
  <ol>
  <li>Issuing a read binary data command</li>
  <li>Blocking waiting for a callback that gives us the data</li>
  <li>Evaluate the response code that tells us whether there are more frames to read.</li>
  <li>If no more then we are done, otherwise continue to read.</li>
  </ol>
  
  <p>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. </p>
  
  <p>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.</p>
  
  <p>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. </p>
  
  <p>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.</p>
  
  <p>Does anyone have any advice on what our issue could be or how we can speed this up.</p>