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

Typedefs | Functions
HAL Card Reader API

HAL Card Reader NFC L1 Interface. More...

## Typedefs
typedef KER_BOOL(KER_API * | CALLBACK_NFCL1_EXCHANGE_APDU) (KER_CTX_PARAM KER_VOID *pCallbackHandle, 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_NFCL1_SEND_C_APDU) (KER_CTX_PARAM KER_VOID *pCallbackHandle, 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)
| Callback type to send APDU requset to card. More...
typedef KER_RES(KER_API * | CALLBACK_NFCL1_RECV_R_APDU) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_INT16U usTimeout, KER_BYTE *pbtDataOut, KER_INT16U *pusDataOut, KER_INT16U usDataOutSize, KER_INT16U *pusSW1SW2, KER_INT32U *pulExecutionTime)
| Callback type to obtain APDU response from card. More...
typedef KER_BOOL(KER_API * | CALLBACK_NFCL1_CARD_FIELD_OFF) (KER_CTX_PARAM KER_VOID *pCallbackHandle)
| Callback type to power down the RF card. More...
typedef KER_RES(KER_API * | CALLBACK_NFCL1_CARD_POLL) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_INT32U ulTimeout, KER_INT16U *pusCardType, KER_BYTE *pbtUID, KER_INT16U *pusUIDLen)
| Callback type to power up the RF card. More...
typedef KER_BOOL(KER_API * | CALLBACK_NFCL1_GET_CARD_INFO) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_INT16U *pusCardType, KER_BYTE *pbtUID, KER_INT16U *pusUIDLen)
| Callback type to get info of a previously tapped card. More...
typedef KER_RES(KER_API * | CALLBACK_NFCL1_CARD_REMOVAL_PROCEDURE) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_INT32U ulTimeout)
| Callback type to perform EMV L1 card removal procedure Called by Entry Point only. More...
typedef KER_BOOL(KER_API * | CALLBACK_NFCL1_RESET_OPERATION_FIELD) (KER_CTX_PARAM KER_VOID *pCallbackHandle)
| Callback type to reset operation field Called by Entry Point only. More...
typedef KER_BOOL(KER_API * | CALLBACK_NFCL1_GET_READER_SERIAL_NUMBER) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_CHAR *pchData, KER_BYTE *pbtDataLen)
| Callback type to get serial number of the Cless IFD. More...
typedef KER_BOOL(KER_API * | CALLBACK_NFCL1_GET_READER_TYPE_ID) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_CHAR *pchData, KER_INT16U *pbtDataLen)
| Callback type to get reader type id of the Cless IFD. More...

## Functions
KER_BOOL | hal_nfcl1_exchange_apdu (KER_CTX_PARAM 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...
KER_BOOL | hal_nfcl1_send_c_apdu (KER_CTX_PARAM 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)
| Send APDU requset to card. More...
KER_RES | hal_nfcl1_recv_r_apdu (KER_CTX_PARAM KER_INT16U usTimeout, KER_BYTE *pbtDataOut, KER_INT16U *pusDataOut, KER_INT16U usDataOutSize, KER_INT16U *pusSW1SW2, KER_INT32U *pulExecutionTime)
| Obtain APDU response from card. More...
KER_RES | hal_nfcl1_card_poll (KER_CTX_PARAM KER_INT32U ulTimeout, KER_INT16U *pusCardType, KER_BYTE *pbtUID, KER_INT16U *pusUIDLen)
| PCD field on and card polling during specified timeout. More...
KER_BOOL | hal_nfcl1_get_card_info (KER_CTX_PARAM KER_INT16U *pusCardType, KER_BYTE *pbtUID, KER_INT16U *pusUIDLen)
| Get info of a previously tapped card. More...
KER_RES | hal_nfcl1_card_removal_procedure (KER_CTX_PARAM KER_INT32U ulTimeout)
| Performs EMV L1 card removal procedure. More...
KER_BOOL | hal_nfcl1_field_off (KER_CTX_SINGLE_PARAM)
| PCD field off request. More...
KER_BOOL | hal_nfcl1_reset_operation_field (KER_CTX_SINGLE_PARAM)
| Reset operation field. More...
KER_BOOL | hal_nfcl1_get_reader_serial_number (KER_CTX_PARAM KER_CHAR *pchData, KER_BYTE *pbtDataLen)
| Get serial number of the IFD. More...
#define | KER_NFCL1_LE_MAX 0x0000
#define | KER_NFCL1_LE_NULL 0xFFFF
#define | KER_NFCL1_APDU_CASE1 0x01
#define | KER_NFCL1_APDU_CASE2 0x02
#define | KER_NFCL1_APDU_CASE3 0x03
#define | KER_NFCL1_APDU_CASE4 0x04
#define | KER_NFCL1_PHISICAL_CARD_TYPE_DEFAULT 0x0000
#define | KER_NFCL1_PHISICAL_CARD_TYPE_NONE 0x0000
#define | KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_A 0x0001
#define | KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_B 0x0002
#define | KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_4_A 0x0004
#define | KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_4_B 0x0008
#define | KER_NFCL1_PHISICAL_CARD_TYPE_MIFARE_A_STD 0x0010
#define | KER_NFCL1_PHISICAL_CARD_TYPE_MIFARE_A_UL 0x0020
#define | KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_AND_MIFARE 0x0040
#define | KER_NFCL1_PHISICAL_CARD_TYPE_UNKNOWN 0x8000
#define | KER_NFCL1_PU_POLLING_TIMEOUT 0xFFFFFFFE
#define | KER_NFCL1_POLLING_TIMEOUT 0xFFFE
#define | KER_NFCL1_DEF_TIMEOUT 0xFFFF
#define | KER_NFCL1_PU_RES_TIMEOUT 0xFD01
#define | KER_NFCL1_PU_RES_COLLISION 0xFD02
#define | KER_NFCL1_PU_RES_COMM_ERROR 0xFD03
#define | KER_NFCL1_PU_RES_FATAL_ERROR 0xFD04
#define | KER_NFCL1_CR_RES_TIMEOUT 0xFD0A
#define | KER_NFCL1_CR_HW_ERROR 0xFD0B
#define | KER_NFCL1_RES_TIMEOUT 0xFE01
#define | KER_NFCL1_RES_PENDING 0xFE02
#define | KER_NFCL1_RES_TRANSMISSION 0xFE03
#define | KER_NFCL1_RES_PROTOCOL 0xFE04
#define | KER_NFCL1_RES_HW_ERROR 0xFE05
#define | KER_NFCL1_RES_UNKNOWN 0xFE0F

## Detailed Description

HAL Card Reader NFC L1 Interface.

This functions should be implemented by terminal application

## Macro Definition Documentation

## ◆ KER_NFCL1_APDU_CASE1

#define KER_NFCL1_APDU_CASE1 0x01

Exchange APDU Case 1 - Command Data: NO Expected Response Data: NO
C-APDU = {CLA INS P1 P2}

## ◆ KER_NFCL1_APDU_CASE2

#define KER_NFCL1_APDU_CASE2 0x02

Exchange APDU Case 2 - Command Data: NO Expected Response Data: YES
C-APDU = {CLA INS P1 P2 Le}

## ◆ KER_NFCL1_APDU_CASE3

#define KER_NFCL1_APDU_CASE3 0x03

Exchange APDU Case 3 - Command Data: YES Expected Response Data: NO
C-APDU = {CLA INS P1 P2 Lc [sDataIn(Lc)]}

## ◆ KER_NFCL1_APDU_CASE4

#define KER_NFCL1_APDU_CASE4 0x04

Exchange APDU Case 4 - Command Data: YES Expected Response Data: YES
C-APDU = {CLA INS P1 P2 Lc [sDataIn(Lc)] Le}

## ◆ KER_NFCL1_CR_HW_ERROR

#define KER_NFCL1_CR_HW_ERROR 0xFD0B

card removal HW error

## ◆ KER_NFCL1_CR_RES_TIMEOUT

#define KER_NFCL1_CR_RES_TIMEOUT 0xFD0A

card removal timeout

## ◆ KER_NFCL1_DEF_TIMEOUT

#define KER_NFCL1_DEF_TIMEOUT 0xFFFF

Use internal PCD wait for R-APDU timeout

## ◆ KER_NFCL1_LE_MAX

#define KER_NFCL1_LE_MAX 0x0000

expected response length is unknown (card may respond with any length available)

## ◆ KER_NFCL1_LE_NULL

#define KER_NFCL1_LE_NULL 0xFFFF

no response data is expected (Le parameter should not be sent to the card)

## ◆ KER_NFCL1_PHISICAL_CARD_TYPE_DEFAULT

#define KER_NFCL1_PHISICAL_CARD_TYPE_DEFAULT 0x0000

Use PCD default card types for palling for (as polling input)

## ◆ KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_4_A

#define KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_4_A 0x0004

ISO 14443.4 Type A Card (T=CL)

## ◆ KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_4_B

#define KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_4_B 0x0008

ISO 14443.4 Type B Card (T=CL)

## ◆ KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_A

#define KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_A 0x0001

ISO 14443 Type A Card

## ◆ KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_AND_MIFARE

#define KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_AND_MIFARE 0x0040

Combined ISO 14443 and Mifare Card - it's better to use mask combination instead

## ◆ KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_B

#define KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_B 0x0002

ISO 14443 Type B Card

## ◆ KER_NFCL1_PHISICAL_CARD_TYPE_MIFARE_A_STD

#define KER_NFCL1_PHISICAL_CARD_TYPE_MIFARE_A_STD 0x0010

Mifare Std Card

## ◆ KER_NFCL1_PHISICAL_CARD_TYPE_MIFARE_A_UL

#define KER_NFCL1_PHISICAL_CARD_TYPE_MIFARE_A_UL 0x0020

Mifare Ultralight Card

## ◆ KER_NFCL1_PHISICAL_CARD_TYPE_NONE

#define KER_NFCL1_PHISICAL_CARD_TYPE_NONE 0x0000

No card located (as polling output )

## ◆ KER_NFCL1_PHISICAL_CARD_TYPE_UNKNOWN

#define KER_NFCL1_PHISICAL_CARD_TYPE_UNKNOWN 0x8000

Unknown card

## ◆ KER_NFCL1_POLLING_TIMEOUT

#define KER_NFCL1_POLLING_TIMEOUT 0xFFFE

R-APDU polling timeout

## ◆ KER_NFCL1_PU_POLLING_TIMEOUT

#define KER_NFCL1_PU_POLLING_TIMEOUT 0xFFFFFFFE

power up polling timeout

## ◆ KER_NFCL1_PU_RES_COLLISION

#define KER_NFCL1_PU_RES_COLLISION 0xFD02

card collision detected

## ◆ KER_NFCL1_PU_RES_COMM_ERROR

#define KER_NFCL1_PU_RES_COMM_ERROR 0xFD03

card communication error

## ◆ KER_NFCL1_PU_RES_FATAL_ERROR

#define KER_NFCL1_PU_RES_FATAL_ERROR 0xFD04

fatal error

## ◆ KER_NFCL1_PU_RES_TIMEOUT

#define KER_NFCL1_PU_RES_TIMEOUT 0xFD01

card polling timeout

## ◆ KER_NFCL1_RES_HW_ERROR

#define KER_NFCL1_RES_HW_ERROR 0xFE05

R-APDU HW error

## ◆ KER_NFCL1_RES_PENDING

#define KER_NFCL1_RES_PENDING 0xFE02

R-APDU pending...

## ◆ KER_NFCL1_RES_PROTOCOL

#define KER_NFCL1_RES_PROTOCOL 0xFE04

R-APDU protocol error

## ◆ KER_NFCL1_RES_TIMEOUT

#define KER_NFCL1_RES_TIMEOUT 0xFE01

R-APDU timeout assigned by R-APDU

## ◆ KER_NFCL1_RES_TRANSMISSION

#define KER_NFCL1_RES_TRANSMISSION 0xFE03

R-APDU transmission error

## ◆ KER_NFCL1_RES_UNKNOWN

#define KER_NFCL1_RES_UNKNOWN 0xFE0F

R-APDU unexpected error

## Typedef Documentation

## ◆ CALLBACK_NFCL1_CARD_FIELD_OFF

typedef KER_BOOL(KER_API * CALLBACK_NFCL1_CARD_FIELD_OFF) (KER_CTX_PARAM KER_VOID *pCallbackHandle)

Callback type to power down the RF card.

Parameters

  [in] | pCallbackHandle | - callback context, obtained from Terminal Application, and stored by hal_register_callback (btCallbackType = KER_HAL_CALLBACK_HANDLE)

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

## ◆ CALLBACK_NFCL1_CARD_POLL

typedef KER_RES(KER_API * CALLBACK_NFCL1_CARD_POLL) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_INT32U ulTimeout, KER_INT16U *pusCardType, KER_BYTE *pbtUID, KER_INT16U *pusUIDLen)

Callback type to power up the RF card.

Parameters

  [in] | pCallbackHandle | - callback context, obtained from Terminal Application, and stored by hal_register_callback (btCallbackType = KER_HAL_CALLBACK_HANDLE)
  [in] | ulTimeout | Card wait in RF timeout
  [out] | pusCardType | Card type, see KER_NFCL1_PHISICAL_CARD_TYPE_NONE, KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_4_A KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_4_B KER_NFCL1_PHISICAL_CARD_TYPE_MIFARE_A_STD KER_NFCL1_PHISICAL_CARD_TYPE_MIFARE_A_UL KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_A KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_B KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_AND_MIFARE KER_NFCL1_PHISICAL_CARD_TYPE_UNKNOWN
  [out] | pbtUID | Card UID, if available
  [in,out] | pusUIDLen | Size of lpbtUID in/out

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

## ◆ CALLBACK_NFCL1_CARD_REMOVAL_PROCEDURE

typedef KER_RES(KER_API* CALLBACK_NFCL1_CARD_REMOVAL_PROCEDURE) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_INT32U ulTimeout)

Callback type to perform EMV L1 card removal procedure Called by Entry Point only.

Parameters

  [in] | pCallbackHandle | - callback context, obtained from Terminal Application, and stored by hal_register_callback (btCallbackType = KER_HAL_CALLBACK_HANDLE)
  [in] | ulTimeout | Card wait in RF timeout (in msec)

Returns
  KER_OK Success.
  KER_NFCL1_CR_RES_TIMEOUT Card removal timeout.
  KER_NFCL1_CR_HW_ERROR Failure. Execution failed due to reader error.

## ◆ CALLBACK_NFCL1_EXCHANGE_APDU

typedef KER_BOOL(KER_API * CALLBACK_NFCL1_EXCHANGE_APDU) (KER_CTX_PARAM KER_VOID *pCallbackHandle, 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] | btApduCase | APDU request type - KER_NFCL1_APDU_CASE1, KER_NFCL1_APDU_CASE2, KER_NFCL1_APDU_CASE3 or KER_NFCL1_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_EXT_NFCL1_LE_MAX or KER_EXT_NFCL1_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.

## ◆ CALLBACK_NFCL1_GET_CARD_INFO

typedef KER_BOOL(KER_API * CALLBACK_NFCL1_GET_CARD_INFO) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_INT16U *pusCardType, KER_BYTE *pbtUID, KER_INT16U *pusUIDLen)

Callback type to get info of a previously tapped card.

Parameters

  [in] | pCallbackHandle | - callback context, obtained from Terminal Application, and stored by hal_register_callback (btCallbackType = KER_HAL_CALLBACK_HANDLE)
  [out] | pusCardType | Card type, see KER_NFCL1_PHISICAL_CARD_TYPE_NONE, KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_4_A KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_4_B KER_NFCL1_PHISICAL_CARD_TYPE_MIFARE_A_STD KER_NFCL1_PHISICAL_CARD_TYPE_MIFARE_A_UL KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_A KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_B KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_AND_MIFARE KER_NFCL1_PHISICAL_CARD_TYPE_UNKNOWN
  [out] | pbtUID | Card UID, if available
  [in,out] | pusUIDLen | Size of lpbtUID in/out

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

## ◆ CALLBACK_NFCL1_GET_READER_SERIAL_NUMBER

typedef KER_BOOL(KER_API * CALLBACK_NFCL1_GET_READER_SERIAL_NUMBER) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_CHAR *pchData, KER_BYTE *pbtDataLen)

Callback type to get serial number of the Cless IFD.

Parameters

  [in] | pCallbackHandle | - callback context, obtained from Terminal Application, and stored by hal_register_callback (btCallbackType = KER_HAL_CALLBACK_HANDLE)
  [out] | pchData | the buffer to fill
  [in,out] | pbtDataLen | the length of data buffer (in/out), 8 or less expected

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_NFCL1_GET_READER_TYPE_ID

typedef KER_BOOL(KER_API* CALLBACK_NFCL1_GET_READER_TYPE_ID) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_CHAR *pchData, KER_INT16U *pbtDataLen)

Callback type to get reader type id of the Cless IFD.

Parameters

  [in] | pCallbackHandle | - callback context, obtained from Terminal Application, and stored by hal_register_callback (btCallbackType = KER_HAL_CALLBACK_HANDLE)
  [out] | pchData | the buffer to fill
  [in,out] | pbtDataLen | the length of data buffer (in/out), 64 bytes recommended

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

## ◆ CALLBACK_NFCL1_RECV_R_APDU

typedef KER_RES(KER_API * CALLBACK_NFCL1_RECV_R_APDU) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_INT16U usTimeout, KER_BYTE *pbtDataOut, KER_INT16U *pusDataOut, KER_INT16U usDataOutSize, KER_INT16U *pusSW1SW2, KER_INT32U *pulExecutionTime)

Callback type to 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] | usTimeout | usTimeout Wait R-APDU timeout (in 100 microseconds, or special values KER_NFCL1_POLLING_TIMEOUT, KER_NFCL1_DEF_TIMEOUT)
  [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
  [out] | pulExecutionTime | APDU command execution time in 100 microseconds (Optional, set KER_NULL if you don't need it)

Returns
  KER_OK Success.
  KER_NFCL1_RES_TIMEOUT R-APDU polling timeout
  KER_NFCL1_RES_TRANSMISSION R-APDU transmission error
  KER_NFCL1_RES_PROTOCOL R-APDU protocol error
  KER_NFCL1_RES_PENDING R-APDU pending...
  KER_NFCL1_RES_HW_ERROR R-APDU HW error
  Other Execution failed due to invalid param or unexpected error.

## ◆ CALLBACK_NFCL1_RESET_OPERATION_FIELD

typedef KER_BOOL(KER_API* CALLBACK_NFCL1_RESET_OPERATION_FIELD) (KER_CTX_PARAM KER_VOID *pCallbackHandle)

Callback type to reset operation field Called by Entry Point only.

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

## ◆ CALLBACK_NFCL1_SEND_C_APDU

typedef KER_BOOL(KER_API * CALLBACK_NFCL1_SEND_C_APDU) (KER_CTX_PARAM KER_VOID *pCallbackHandle, 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)

Callback type to send APDU requset to card.

Parameters

  [in] | pCallbackHandle | - callback context, obtained from Terminal Application, and stored by hal_register_callback (btCallbackType = KER_HAL_CALLBACK_HANDLE)
  [in] | btApduCase | APDU request type - KER_NFCL1_APDU_CASE1, KER_NFCL1_APDU_CASE2, KER_NFCL1_APDU_CASE3 or KER_NFCL1_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_EXT_NFCL1_LE_MAX or KER_EXT_NFCL1_LE_NULL

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

## Function Documentation

## ◆ hal_nfcl1_card_poll()

KER_RES hal_nfcl1_card_poll | ( | KER_CTX_PARAM KER_INT32U | ulTimeout,
|  | KER_INT16U * | pusCardType,
|  | KER_BYTE * | pbtUID,
|  | KER_INT16U * | pusUIDLen
| ) |  |

PCD field on and card polling during specified timeout.

Parameters

  [in] | ulTimeout | Card polling timeout (in msec, or special value KER_NFCL1_PU_POLLING_TIMEOUT for external polling)
  [in,out] | pusCardType | Card type polling for bitmask as input (set KER_NFCL1_PHISICAL_CARD_TYPE_DEFAULT to use internal PCD configuration), located card type as output (optional, set KER_NULL for PCD default settings), see KER_NFCL1_PHISICAL_CARD_TYPE_DEFAULT, KER_NFCL1_PHISICAL_CARD_TYPE_NONE, KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_A KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_B KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_4_A KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_4_B KER_NFCL1_PHISICAL_CARD_TYPE_MIFARE_A_STD KER_NFCL1_PHISICAL_CARD_TYPE_MIFARE_A_UL KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_AND_MIFARE KER_NFCL1_PHISICAL_CARD_TYPE_UNKNOWN
  [out] | pbtUID | Card UID, if available
  [in,out] | pusUIDLen | Size of pbtUID in/out

Returns
  KER_OK Success
  KER_NFCL1_PU_RES_TIMEOUT polling timeout
  KER_NFCL1_PU_RES_COLLISION card collision detected
  KER_NFCL1_PU_RES_COMM_ERROR card communication error
  Other - failure. Execution failed due to reader error.

## ◆ hal_nfcl1_card_removal_procedure()

KER_RES hal_nfcl1_card_removal_procedure | ( | KER_CTX_PARAM KER_INT32U | ulTimeout | ) |

Performs EMV L1 card removal procedure.

Parameters

  [in] | ulTimeout | Card wait in RF timeout (in msec)

Returns
  KER_OK Success.
  KER_NFCL1_CR_RES_TIMEOUT Card removal timeout.
  KER_NFCL1_CR_HW_ERROR Failure. Execution failed due to reader error.

## ◆ hal_nfcl1_exchange_apdu()

KER_BOOL hal_nfcl1_exchange_apdu | ( | KER_CTX_PARAM 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.

Parameters

  [in] | btApduCase | APDU request type - KER_NFCL1_APDU_CASE1, KER_NFCL1_APDU_CASE2, KER_NFCL1_APDU_CASE3 or KER_NFCL1_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_EXT_NFCL1_LE_MAX or KER_EXT_NFCL1_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.

## ◆ hal_nfcl1_field_off()

KER_BOOL hal_nfcl1_field_off | ( | KER_CTX_SINGLE_PARAM |  | ) |

PCD field off request.

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

## ◆ hal_nfcl1_get_card_info()

KER_BOOL hal_nfcl1_get_card_info | ( | KER_CTX_PARAM KER_INT16U * | pusCardType,
|  | KER_BYTE * | pbtUID,
|  | KER_INT16U * | pusUIDLen
| ) |  |

Get info of a previously tapped card.

Parameters

  [out] | pusCardType | Card type, see KER_NFCL1_PHISICAL_CARD_TYPE_NONE, KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_4_A KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_4_B KER_NFCL1_PHISICAL_CARD_TYPE_MIFARE_A_STD KER_NFCL1_PHISICAL_CARD_TYPE_MIFARE_A_UL KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_A KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_B KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_AND_MIFARE KER_NFCL1_PHISICAL_CARD_TYPE_UNKNOWN
  [out] | pbtUID | Card UID, if available
  [in,out] | pusUIDLen | Size of lpbtUID in/out

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

## ◆ hal_nfcl1_get_reader_serial_number()

KER_BOOL hal_nfcl1_get_reader_serial_number | ( | KER_CTX_PARAM KER_CHAR * | pchData,
|  | KER_BYTE * | pbtDataLen
| ) |  |

Get serial number of the IFD.

Parameters

  [out] | pchData | the buffer to fill
  [in,out] | pbtDataLen | the length of data buffer (in/out), 8 or less expected

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

## ◆ hal_nfcl1_recv_r_apdu()

KER_RES hal_nfcl1_recv_r_apdu | ( | KER_CTX_PARAM KER_INT16U | usTimeout,
|  | KER_BYTE * | pbtDataOut,
|  | KER_INT16U * | pusDataOut,
|  | KER_INT16U | usDataOutSize,
|  | KER_INT16U * | pusSW1SW2,
|  | KER_INT32U * | pulExecutionTime
| ) |  |

Obtain APDU response from card.

Parameters

  [in] | usTimeout | Wait R-APDU timeout (in 100 microseconds, or special values KER_NFCL1_POLLING_TIMEOUT, KER_NFCL1_DEF_TIMEOUT)
  [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
  [out] | pulExecutionTime | APDU command execution time in 100 microseconds (Optionl, set KER_NULL if you don't need it)

Returns
  KER_OK Success.
  KER_NFCL1_RES_TIMEOUT R-APDU polling timeout
  KER_NFCL1_RES_TRANSMISSION R-APDU transmission error
  KER_NFCL1_RES_PROTOCOL R-APDU protocol error
  KER_NFCL1_RES_PENDING R-APDU pending...
  KER_NFCL1_RES_HW_ERROR R-APDU HW error
  Other Execution failed due to invalid param or unexpected error.

## ◆ hal_nfcl1_reset_operation_field()

KER_BOOL hal_nfcl1_reset_operation_field | ( | KER_CTX_SINGLE_PARAM |  | ) |

Reset operation field.

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

## ◆ hal_nfcl1_send_c_apdu()

KER_BOOL hal_nfcl1_send_c_apdu | ( | KER_CTX_PARAM 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
| ) |  |

Send APDU requset to card.

Parameters

  [in] | btApduCase | APDU request type - KER_NFCL1_APDU_CASE1, KER_NFCL1_APDU_CASE2, KER_NFCL1_APDU_CASE3 or KER_NFCL1_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_EXT_NFCL1_LE_MAX or KER_EXT_NFCL1_LE_NULL

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