C API for BALTECH SDK

§ brp_VHL_ExchangeAPDU()

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.

Keep an eye on the frame size

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 Sys.GetBufferSize and refer to the TotalSize response value.

For larger amount of data, please useVHL.ExchangeLongAPDU instead.

No error correction or retry mechanisms

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.

Parameters
[in]protocolused to execute the command
[in]AssumedCardTypeForces the reader to assume a certain card type. By default (i.e. if CardType is 0x00), the reader uses the card type detected by VHL.Select.
[in]CmdAPDU command data
[in]Cmd_len
[out]RespAPDU response data
[out]Resp_len
[in]mempoolis 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