AT-NFC 2.1 (win) AT-NFC kernel set

Typedefs | Functions
hal_emvl1.h File Reference

Go to the source code of this file.

## Macros
#define | KER_EMVL1_PROTOCOL_T0 0x00
#define | KER_EMVL1_PROTOCOL_T1 0x01
#define | KER_EMVL1_RESET_SMART 0x00
#define | KER_EMVL1_RESET_AUTO 0x01
#define | KER_EMVL1_RESET_COLD 0x02
#define | KER_EMVL1_RESET_WARM 0x03
#define | KER_EMVL1_LE_MAX 0x0000
#define | KER_EMVL1_LE_NULL 0xFFFF
#define | KER_EMVL1_APDU_CASE1 0x01
#define | KER_EMVL1_APDU_CASE2 0x02
#define | KER_EMVL1_APDU_CASE3 0x03
#define | KER_EMVL1_APDU_CASE4 0x04

## Typedefs
typedef KER_BOOL(KER_API * | CALLBACK_EMVL1_RESET_CARD) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_BYTE btResetType, KER_BYTE *pbtATR, KER_BYTE *pbtATRLen, KER_BYTE btATRLenMax)
| Callback type for reset command to the card reader. More...
typedef KER_BOOL(KER_API * | CALLBACK_EMVL1_EXCHANGE_APDU) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_BYTE btProtocol, KER_BYTE btApduCase, KER_BYTE btCLA, KER_BYTE btINS, KER_BYTE btP1, KER_BYTE btP2, KER_INT16U usLc, const KER_BYTE *pbtDataIn, KER_INT16U usLe, KER_BYTE *pbtDataOut, KER_INT16U *pusDataOut, KER_INT16U usDataOutSize, KER_INT16U *pusSW1SW2)
| Callback type to send APDU requset and obtain APDU response from card. More...
typedef KER_BOOL(KER_API * | CALLBACK_EMVL1_GET_IFD_SERIAL) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_CHAR *pbtSerialNumber, KER_BYTE *pbtSerialNumberLen, KER_BYTE btSerialNumberLenMax)
| Callback type for reset command to the card reader. More...

## Functions
KER_BOOL | hal_emvl1_reset_card (KER_CTX_PARAM KER_BYTE btResetType, KER_BYTE *pbtATR, KER_BYTE *pbtATRLen, KER_BYTE btATRLenMax)
| Reset command to the card reader. More...
KER_BOOL | hal_emvl1_exchange_apdu (KER_CTX_PARAM KER_BYTE btProtocol, KER_BYTE btApduCase, KER_BYTE btCLA, KER_BYTE btINS, KER_BYTE btP1, KER_BYTE btP2, KER_INT16U usLc, const KER_BYTE *pbtDataIn, KER_INT16U usLe, KER_BYTE *pbtDataOut, KER_INT16U *pusDataOut, KER_INT16U usDataOutSize, KER_INT16U *pusSW1SW2)
| Send APDU requset and obtain APDU response from card. More...

## Detailed Description

HAL card reader EMV Level 1 interface definition

## Typedef Documentation

## ◆ CALLBACK_EMVL1_EXCHANGE_APDU

typedef KER_BOOL(KER_API * CALLBACK_EMVL1_EXCHANGE_APDU) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_BYTE btProtocol, KER_BYTE btApduCase, KER_BYTE btCLA, KER_BYTE btINS, KER_BYTE btP1, KER_BYTE btP2, KER_INT16U usLc, const KER_BYTE *pbtDataIn, KER_INT16U usLe, KER_BYTE *pbtDataOut, KER_INT16U *pusDataOut, KER_INT16U usDataOutSize, KER_INT16U *pusSW1SW2)

Callback type to send APDU requset and obtain APDU response from card.

Parameters

  [in] | pCallbackHandle | - callback context, obtained from Terminal Application, and stored by hal_register_callback (btCallbackType = KER_HAL_CALLBACK_HANDLE)
  [in] | btProtocol | Chip protocol type KER_EMVL1_PROTOCOL_T0 or KER_EMVL1_PROTOCOL_T1
  [in] | btApduCase | APDU request type - KER_EMVL1_APDU_CASE1, KER_EMVL1_APDU_CASE2, KER_EMVL1_APDU_CASE3 or KER_EMVL1_APDU_CASE4
  [in] | btCLA | Class of Instruction
  [in] | btINS | Instruction Code
  [in] | btP1 | Instruction Parameter 1
  [in] | btP2 | Instruction Parameter 2
  [in] | usLc | The pbtDataIn data length
  [in] | pbtDataIn | The data to send to the card
  [in] | usLe | Expected length of response data from card (if known), or KER_EMVL1_LE_MAX or KER_EMVL1_LE_NULL
  [out] | pbtDataOut | Buffer to obtain command response data sent by the card
  [out] | pusDataOut | Length of data placed in pbtDataOut
  [in] | usDataOutSize | pbtDataOut buffer size
  [out] | pusSW1SW2 | card response status bytes

Returns
  KER_TRUE Success.
  KER_FALSE Failure. Execution failed due to invalid param or reader error.

Warning
  Deprecated function. Use it only for backward compatibility

## ◆ CALLBACK_EMVL1_GET_IFD_SERIAL

typedef KER_BOOL(KER_API * CALLBACK_EMVL1_GET_IFD_SERIAL) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_CHAR *pbtSerialNumber, KER_BYTE *pbtSerialNumberLen, KER_BYTE btSerialNumberLenMax)

Callback type for reset command to the card reader.

Parameters

  [in] | pCallbackHandle | - callback context, obtained from Terminal Application, and stored by hal_register_callback (btCallbackType = KER_HAL_CALLBACK_HANDLE)
  [out] | pbtSerialNumber | Buffer to obtain IFD serial number string (up to 8 numerical symbols)
  [out] | pbtSerialNumberLen | Length of data placed in pbtSerialNumber
  [in] | btSerialNumberLenMax | pbtSerialNumber buffer size

Returns
  KER_TRUE Success.
  KER_FALSE Failure. Execution failed due to invalid param or reader error.

Warning
  Deprecated function. Use it only for backward compatibility.

## ◆ CALLBACK_EMVL1_RESET_CARD

typedef KER_BOOL(KER_API * CALLBACK_EMVL1_RESET_CARD) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_BYTE btResetType, KER_BYTE *pbtATR, KER_BYTE *pbtATRLen, KER_BYTE btATRLenMax)

Callback type for reset command to the card reader.

Parameters

  [in] | pCallbackHandle | - callback context, obtained from Terminal Application, and stored by hal_register_callback (btCallbackType = KER_HAL_CALLBACK_HANDLE)
  [in] | btResetType | Card reset type KER_EMVL1_RESET_SMART KER_EMVL1_RESET_AUTO KER_EMVL1_RESET_COLD or KER_EMVL1_RESET_WARM
  [out] | pbtATR | Buffer to obtain ATR (answer to reset) sent by the card
  [out] | pbtATRLen | Length of data placed in btATR
  [in] | btATRLenMax | pbtDataOut buffer size

Returns
  KER_TRUE Success.
  KER_FALSE Failure. Execution failed due to invalid param or reader error.

Warning
  Deprecated function. Use it only for backward compatibility