0

I am transferring bytes to and reading bytes from some tag technologies; NfcA, MifareUltralight, IsoDep (Mifare Desfire), NfcF(FeliCa Lite-S) and MifareClassic. These all have a transceive(byte[]) function for transmitting commands. For my work it is important that i detect when a CRC error has occurd, however, the description of how the transceive function handles CRC is rather brief. The CRC is added by the transceive function and is removed when a responce is received from the tag. How can i detect when a CRC error has occurred? From what i can see, the transceive functions throw two kinds of exceptions: IOException and TagLostException, and it seems reasonable that a CRC error would result in a IOException, however is that the only time a IOException is thrown?

Any help is appreciated..

Aage Dahl
  • 25
  • 8

1 Answers1

2

By taking a look into the description of the transceive command:
It throws an IOException if there is an I/O failure, or the operation is canceled.

Therefore, not only CRC, but also time out, parity, framing errors, ... are detected. Errors depend on the NFC controller in the Android device.

pizzaani
  • 332
  • 1
  • 9