The ECHO instruction has been designed to test the driver and/or the libraries between the application and the reader. It allows to send and receive arbitrary length of data, and to simulate delayed answers and spurious card removals.
|P2||Delay and options||See table below|
|Lc||Length of DataIn|
|DataIn||Arbitrary data to send to the card (in fact, to the reader)||Can be empty|
|Le||Length of requested DataOut||Can be 0|
Note: this command supports extended APDU format. Lc and Le can theoretically go up to 64kB, yet the actual maximum size supported by the reader depends on its architecture and firmware options, please check with the datasheet.
Delay and options (P2)
P2 is an array of bits with the following definition:
|5-0||Delay in seconds
|DataOut||Arbitrary data (length equal to Le)|
How is DataOut generated?
DataOut is a deterministic value, which allows the test application to check that no byte has been lost.
|Bytes from i = 0 to i = Lc-1 (if Lc > 0)||DataOut[i] = DataIn[i] (echo)|
|Bytes from i = Lc to i = Le-1 (if Le > Lc)||DataOut[i] = i|
Response if card removal requested in P2
The reader does not provide a R-APDU, the SCardTransmit function shall return SCARD_W_REMOVED_CARD.
||No DataIn, wait 15s and return 16 bytes|
||No DataIn, wait 15s and simulate a spurious card removal|
||Send 248 bytes to the reader in DataIn (short APDU)|
||Receive 248 bytes form the reader in DataOut (short APDU)|
||Echo of 248 bytes (short APDU)|
||Send 4080 bytes to the reader in DataIn (extended APDU)|
||Receive 4080 bytes form the reader in DataOut (extended APDU)|
||Echo of 4080 bytes (extended APDU)|