Hello, I'm trying to use the CardSession sample code in an iPhone app I have received the HCE entitlement, the select identifier array contains only one AID of 8 bytes: FAEBDA5003020000, that is a custom AID that we use on ou custom access control system.
We have the complete control of the NFC reader, when we detect a MiFare card, the reader application send the SELECT AID command and the card number is return and checked We want to do the same with an iPhone instead of the MiFare card, so we use the CardSesion sample in our app, here is the log of the reader application when we present the iPhone on it:
TX: 0x04 0xfc 0xd4 0x4a 0x01 0x00 0xe1 0x00
RX: 0x00 0x00 0xff 0x00 0xff 0x00 ACK
RX: 0x00 0x00 0xff 0x11 0xef 0xd5 0x4b 0x01 0x01 0x00 0x04 0x20 0x04 0x08 0x10 0x53 0x17 0x05 0x78 0x80 0x71 0x00 0xc6 0x00
// SMARTPHONE NFC type 1
pn532InSelect
TX: 0x03 0xfd 0xd4 0x54 0x01 0xd7 0x00
RX: 0x00 0x00 0xff 0x00 0xff 0x00 ACK
RX: 0x00 0x00 0xff 0x03 0xfd 0xd5 0x55 0x00 0xd6 0x00 pn532InDataExchange
TX: 0x12 0xee 0xd4 0x40 0x01 0x00 0xa4 0x04 0x00 0x08 0xfa 0xeb 0xda 0x50 0x03 0x02 0x00 0x00 0x00 0x00 0x27 0x00
RX: 0x00 0x00 0xff 0x00 0xff 0x00 ACK
RX: 0x00 0x00 0xff 0x05 0xfb 0xd5 0x41 0x00 0x6a 0x81 0xff 0x00
we use the select application command and give our 8 bytes AID number: 0xfa 0xeb 0xda 0x50 0x03 0x02 0x00 0x00 the reader receives 6A 81 which means according to our apdu documentation: "Function not supported"
How can we make it work ?
Hello, thank you for the advices The problem is now solved, it was an error in the select command, after the AID number (8 bytes in our case) the reader was adding two zero for the CRC, on Android device this was working but iOS requires that we compute a correct LRC. With the correct LRC value, the command is accepted by iOS device and we can exchange data. As the corrected command is also accepted by Android device, we have a solution that works for both