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

Functions
Export Functions

NFC Kernel library export functions. More...

## Functions
KER_RES KER_API | epKerTranPreprocessing (KER_CTX_PARAM const NFC_EXT_TERM_TRAN_DATA *pTermTranData, const NFC_EP_PRE_DATA *pEpPRE)
| Initiates transaction preprocessing by kernel. More...
KER_RES KER_API | epKerTranStart (KER_CTX_PARAM const NFC_EP_PRE_DATA *pEpPRE, const NFC_EP_PPSE_DATA *pEpPPSE, NFC_EP_TRAN_DATA *pEpTranData, KER_TRAN **ppTran, NFC_OUTCOME **ppOutcome)
| Initiates transaction processing by kernel. More...
KER_RES KER_API | epKerTranIssUpdate (KER_CTX_PARAM KER_TRAN *pTran, const NFC_EP_PRE_DATA *pEpPRE, const NFC_EP_PPSE_DATA *pEpPPSE, NFC_EP_TRAN_DATA *pEpTranData, const NFC_EP_RESTART_DATA *pEpRestartData, const NFC_EXT_TERM_RESTART_DATA *pTermRestartData, NFC_OUTCOME **ppOutcome)
| Initiates issuer update processing by kernel. More...
KER_RES KER_API | epKerTranRelease (KER_CTX_PARAM KER_TRAN *pTran, const NFC_EP_PRE_DATA *pEpPRE)
| Releases NFC Transaction container structure. More...
KER_RES KER_API | epKerGetData (KER_CTX_PARAM KER_TRAN *pTran, const NFC_EP_PRE_DATA *pEpPRE, KER_INT16U usOptions, KER_BYTE *pbtData, KER_INT16U *pusDataLen)
| Transaction data request. More...
KER_RES KER_API | epKerGetDataByTag (KER_CTX_PARAM KER_TRAN *pTran, const NFC_EP_PRE_DATA *pEpPRE, KER_INT16U usOptions, const KER_BYTE *pbtTag, KER_BYTE btTagSize, KER_BYTE *pbtData, KER_INT16U *pusDataSize)
| transaction data request More...
KER_RES KER_API | epKerGetDataByTagList (KER_CTX_PARAM KER_TRAN *pTran, const NFC_EP_PRE_DATA *pEpPRE, KER_INT16U usOptions, const KER_BYTE *pbtTagList, KER_INT16U usTagListSize, KER_BYTE *pbtData, KER_INT16U *pusDataSize)
| transaction data request More...
KER_RES KER_API | epKerGetDataByID (KER_CTX_PARAM KER_TRAN *pTran, const NFC_EP_PRE_DATA *pEpPRE, KER_INT16U usID, KER_BYTE *pbtData, KER_INT16U *pusDataSize)
| Obtain emv data by ID. More...

## Detailed Description

NFC Kernel library export functions.

This functions should be should be implemented for entry point This is general API for all contacless emv kernels implementations

## Function Documentation

## ◆ epKerGetData()

KER_RES KER_API epKerGetData | ( | KER_CTX_PARAM KER_TRAN * | pTran,
|  | const NFC_EP_PRE_DATA * | pEpPRE,
|  | KER_INT16U | usOptions,
|  | KER_BYTE * | pbtData,
|  | KER_INT16U * | pusDataLen
| ) |  |

Transaction data request.

call this function to obtain transaction data from kernel (as a flat TLV with all data available)

Parameters

  [in] | pTran | - pointer to the transaction structure (obtained by epKerTranStart)
  [in] | pEpPRE | - Entry Point preprocesing data
  [in] | usOptions | - get options (bitmask), reserved
  [out] | pbtData | - Buffer to obtain transaction data (in TLV) (path KER_NULL if you need to calculate tran data length only)
  [in,out] | pusDataLen | - Size of Buffer pbtData as input, data length as output

Returns
  KER_OK Success
  Other Failure

## ◆ epKerGetDataByID()

KER_RES KER_API epKerGetDataByID | ( | KER_CTX_PARAM KER_TRAN * | pTran,
|  | const NFC_EP_PRE_DATA * | pEpPRE,
|  | KER_INT16U | usID,
|  | KER_BYTE * | pbtData,
|  | KER_INT16U * | pusDataSize
| ) |  |

Obtain emv data by ID.

call this function to obtain kernel nfc data by ID

Parameters

  [in] | pTran | - pointer to the transaction structure (obtained by epKerTranStart) Optional, set KER_NULL if you request data not associated with particular transaction
  [in] | pEpPRE | - Entry Point preprocesing data
  [in] | usID | - requested data ID (see hal_config.h & hal_nfc_config.h)
  [out] | pbtData | - buffer to obtain provided ID value
  [in,out] | pusDataSize | - pbtData buffer size as input, output containes result data length

Returns
  KER_OK - Success, requested data provided
  KER_ERR_COMMON_NOT_FOUND - Data not found
  Other - Failure...

## ◆ epKerGetDataByTag()

KER_RES KER_API epKerGetDataByTag | ( | KER_CTX_PARAM KER_TRAN * | pTran,
|  | const NFC_EP_PRE_DATA * | pEpPRE,
|  | KER_INT16U | usOptions,
|  | const KER_BYTE * | pbtTag,
|  | KER_BYTE | btTagSize,
|  | KER_BYTE * | pbtData,
|  | KER_INT16U * | pusDataSize
| ) |  |

transaction data request

call this function to obtain transaction data by tag from kernel

Parameters

  [in] | pTran | - pointer to the transaction structure (obtained by epKerTranStart)
  [in] | pEpPRE | - Entry Point preprocesing data
  [in] | usOptions | - get options (bitmask), reserved
  [in] | pbtTag | - buffer with tag value
  [in] | btTagSize | - pbtTag value length
  [out] | pbtData | - buffer to obtain provided tag value
  [in,out] | pusDataSize | - pbtData buffer size as input, output containes result data length

Returns
  KER_OK Success
  KER_ERR_COMMON_NOT_FOUND Tag not found
  Other Failure

## ◆ epKerGetDataByTagList()

KER_RES KER_API epKerGetDataByTagList | ( | KER_CTX_PARAM KER_TRAN * | pTran,
|  | const NFC_EP_PRE_DATA * | pEpPRE,
|  | KER_INT16U | usOptions,
|  | const KER_BYTE * | pbtTagList,
|  | KER_INT16U | usTagListSize,
|  | KER_BYTE * | pbtData,
|  | KER_INT16U * | pusDataSize
| ) |  |

transaction data request

call this function to obtain transaction data by tag list from kernel

Parameters

  [in] | pTran | - pointer to the transaction structure (obtained by epKerTranStart)
  [in] | pEpPRE | - Entry Point preprocesing data
  [in] | usOptions | - get options (bitmask), reserved
  [in] | pbtTagList | - buffer with tag list
  [in] | usTagListSize | - pbtTagList value length
  [out] | pbtData | - buffer to obtain provided tag list in TLV format
  [in,out] | pusDataSize | - pbtData buffer size as input, output containes result data length

Returns
  KER_OK Success
  Other Failure

## ◆ epKerTranIssUpdate()

KER_RES KER_API epKerTranIssUpdate | ( | KER_CTX_PARAM KER_TRAN * | pTran,
|  | const NFC_EP_PRE_DATA * | pEpPRE,
|  | const NFC_EP_PPSE_DATA * | pEpPPSE,
|  | NFC_EP_TRAN_DATA * | pEpTranData,
|  | const NFC_EP_RESTART_DATA * | pEpRestartData,
|  | const NFC_EXT_TERM_RESTART_DATA * | pTermRestartData,
|  | NFC_OUTCOME ** | ppOutcome
| ) |  |

Initiates issuer update processing by kernel.

This function initiates NFC issuer update after online request completion

Parameters

  [in] | pTran | - pointer to the transaction structure (obtained by epKerTranStart)
  [in] | pEpPRE | - Entry Point preprocesing data
  [in] | pEpPPSE | - Entry Point selected aid related PPSE data
  [in] | pEpTranData | - transaction data maintained by Entry Point
  [in] | pEpRestartData | - transaction restart data maintained by Entry Point
  [in] | pTermRestartData | - transaction restart data (issuer data)
  [out] | ppOutcome | - pointer to obtain transaction outcome

Returns
  KER_OK Success, see outcome for details.
  KER_ERR_COMMON_CARD_HW_ERR Card communication failure - abort transaction
  Other errors (Kernel Error Codes) Failure - abort transaction.

## ◆ epKerTranPreprocessing()

KER_RES KER_API epKerTranPreprocessing | ( | KER_CTX_PARAM const NFC_EXT_TERM_TRAN_DATA * | pTermTranData,
|  | const NFC_EP_PRE_DATA * | pEpPRE
| ) |  |

Initiates transaction preprocessing by kernel.

This function initiates NFC transaction preprocessing by kernel (optional, for EMV/MS mode "on fly" check)

Parameters

  [in] | pTermTranData | - transaction data, obtained from terminal (optional, set KER_NULL for fixed tran data)
  [in] | pEpPRE | - Entry Point preprocesing data

Returns
  KER_OK Success
  Other Preprocessing failed

## ◆ epKerTranRelease()

KER_RES KER_API epKerTranRelease | ( | KER_CTX_PARAM KER_TRAN * | pTran,
|  | const NFC_EP_PRE_DATA * | pEpPRE
| ) |  |

Releases NFC Transaction container structure.

Parameters

  [in] | pTran | - pointer to the transaction structure to release (obtained by epKerTranStart)
  [in] | pEpPRE | - Entry Point preprocesing data

Returns
  KER_OK Success.
  Other - Failure. Execution failed due to invalid param or memory error.

## ◆ epKerTranStart()

KER_RES KER_API epKerTranStart | ( | KER_CTX_PARAM const NFC_EP_PRE_DATA * | pEpPRE,
|  | const NFC_EP_PPSE_DATA * | pEpPPSE,
|  | NFC_EP_TRAN_DATA * | pEpTranData,
|  | KER_TRAN ** | ppTran,
|  | NFC_OUTCOME ** | ppOutcome
| ) |  |

Initiates transaction processing by kernel.

This function initiates NFC transaction processing by kernel, based on Select command results (from EP)

Parameters

  [in] | pEpPRE | - Entry Point preprocesing data
  [in] | pEpPPSE | - Entry Point selected aid related PPSE data
  [in] | pEpTranData | - transaction data maintained by Entry Point
  [out] | ppTran | - pointer to created transaction structure
  [out] | ppOutcome | - pointer to obtain transaction outcome

Returns
  KER_OK Success, see outcome for details.
  KER_ERR_COMMON_CARD_HW_ERR Card communication failure - abort transaction
  Other errors (Kernel Error Codes) Failure - abort transaction.

Warning
  When tranaction context (ppTran) no longer required call epKerTranRelease. Do it despite of result code retuned.