0
votes

I'm working on a project in order to exchange large data from PC to Android device throught NFC. I'm using ACR122.

The following is a general exemple of data sent :

// ADPU
FF FF 00 00 00 nn   // CLA, INS, P1, P2, Le, Lc
D4 40               // TFI, PD0
01                  // (Mi), Target

// LLCP
13 20               // DSAP, PTYPE, SSAP
00                  // Sequence
D4 40               // TFI, PD0

// SNEP
10 02               // Protocol Version, Action
nn nn nn nn         // Total SNEP Length

// NDEF Header
A2                  // First byte (MB = 1, ME = 0, Cf = 1, SR = 0, Il, TNF)
22                  // Type length
mm mm mm mm         // Payload length

// NDEF Content
61.....65           // Type (34 bytes in that case)
01.....01           // Payload (mm mm mm mm bytes)

Here, I send a Record (not short record).So the NDEF header allows to enter a 4 bytes payload length.
Finaly, my question is how could we send a such large payload regarding the 1 byte APDU Lc ?
If this limitation is only due to the pn532 chip or PS/SC, what alternative hardware would you suggest ?

Thank you for any clarification

EDIT :
I found what I was looking for here :
Sending Extended APDU to Javacard
It's a hardware problem, PN532 don't support Extended APDU.

1
You can't split the data into chunks? just out of curiosity, how large it is?Slime recipe
Splitting in chunk imply specifying the Sequence Number (LLCP). The sequence number can't exced 16 (4 bits). 16 sequences of ~250bytes is very far from the possible FF FF FF FF value of the SNEP payload length. I just experiment the NFC, but I try to send about 100 kb.Inset07
I may just confuse you. but 100 k(bytes) sound like a huge number for what these tags can usually handle. so if I understand correctly, you don't have enough memory space for your requirements on the card? in that case your problem is the card, not the supporting hardware.Slime recipe
I think you misunderstand the problem, I'm talking about sending data from PC to Android deviceInset07

1 Answers

0
votes

As you've already found out the ACR122 does not support extended APDU due to a limitation of the PN532 chip.

However, there is no need to pack the entire SNEP transfer into a single APDU. You can split the payload into multiple smaller frames and send them one after another. It's only important that the NDEF header gets transmitted as a whole in the first frame.