BALTECH Docs |
C API for BALTECH SDK
|
brp_errcode brp_VHL_ExchangeAPDU | ( | brp_protocol | protocol, |
brp_CardType | AssumedCardType, | ||
brp_buf | Cmd, | ||
size_t | Cmd_len, | ||
brp_buf * | Resp, | ||
size_t * | Resp_len, | ||
brp_mempool * | mempool | ||
) |
This command sends APDUs to the currently selected card.
APDUs are the communication units between a reader and an ISO 14443-4 card. They're defined in the ISO/IEC 7816-4 standard. VHL.ExchangeAPDU transmits the actual APDU command via the Cmd parameter and returns the APDU response as Resp.
The combined size of transmitted and received APDU data (i.e. the combined size of Cmd and Resp) must not exceed the maximum frame size supported by your reader's firmware version. To check the maximum frame size, run brp_Sys_GetBufferSize() and refer to the TotalSize response value.
For larger amount of data, please use brp_VHL_ExchangeLongAPDU() instead.
The reader firmware does not perform any error handling operations with ISO/IEC 7816-4 inter-industry commands. Errors will be directly reported as part of the Resp value without further action, so you have to take care of error handling in your application.
[in] | protocol | used to execute the command |
[in] | AssumedCardType | Forces the reader to assume a certain card type. By default (i.e. if CardType is 0x00), the reader uses the card type detected by brp_VHL_Select(). |
[in] | Cmd | APDU command data |
[in] | Cmd_len | |
[out] | Resp | APDU response data |
[out] | Resp_len | |
[in] | mempool | is used to store response data. Maybe NULL to use an internal mempool, in this case the data is only available until another command uses the internal mempool |