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

Typedefs | Functions
HAL NFC Data Exchange API

HAL NFC Data Exchange Interface. More...

## Typedefs
typedef KER_BOOL(KER_API * | CALLBACK_NFC_DE_DATA_FROM_KERNEL) (KER_CTX_PARAM KER_VOID *pCallbackHandle, const KER_BYTE *pbtData, KER_INT16U usDataLen)
| Callback type for data exchange. More...
typedef KER_INT16U(KER_API * | CALLBACK_NFC_DE_DATA_FROM_TERMINAL) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_INT16U usTimeout, KER_INT16U usParam, KER_VOID *pParam, KER_BYTE **ppbtData, KER_INT16U *pusDataLen)
| Callback type for data exchange. More...
typedef KER_BOOL(KER_API * | CALLBACK_NFC_DE_DATA_RELEASE) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_BYTE *pbtData)
| Callback type for data exchange. More...
typedef KER_BOOL(KER_API * | CALLBACK_NFC_DE_DATA_RELEASE_EX) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_BYTE *pbtData, KER_INT16U usDataLen)
| Callback type for data exchange. More...

## Functions
KER_BOOL | hal_nfc_de_set_data_from_kernel (KER_CTX_PARAM const KER_BYTE *pbtData, KER_INT16U usDataLen)
| Data exchange: pass data from kernel. More...
KER_INT16U | hal_nfc_de_get_data_from_terminal (KER_CTX_PARAM KER_INT16U usTimeout, KER_INT16U usParam, KER_VOID *pParam, KER_BYTE **ppbtData, KER_INT16U *pusDataLen)
| Data exchange: obtain updated transaction data from terminal. More...
KER_BOOL | hal_nfc_de_release (KER_CTX_PARAM KER_BYTE *pbtData)
| Data exchange: release memory allocated by hal_nfc_de_get_data_from_terminal. More...
KER_BOOL | hal_nfc_de_release_ex (KER_CTX_PARAM KER_BYTE *pbtData, KER_INT16U usDataLen)
| Data exchange: release memory allocated by hal_nfc_de_get_data_from_terminal. More...
#define | HAL_NFC_DE_RES_OK 0x0000
#define | HAL_NFC_DE_RES_TIMEOUT 0x0001
#define | HAL_NFC_DE_RES_NO_DATA 0x0002
#define | HAL_NFC_DE_RES_FAIL 0x0003
#define | HAL_NFC_DE_DET_POLLING_TIMEOUT 0xFFFE
#define | HAL_NFC_DE_DET_DEF_TIMEOUT 0xFFFF

## Detailed Description

HAL NFC Data Exchange Interface.

This functions should be implemented by terminal application

## Macro Definition Documentation

## ◆ HAL_NFC_DE_DET_DEF_TIMEOUT

#define HAL_NFC_DE_DET_DEF_TIMEOUT 0xFFFF

Default wait DET timeout to wait after DEK

## ◆ HAL_NFC_DE_DET_POLLING_TIMEOUT

#define HAL_NFC_DE_DET_POLLING_TIMEOUT 0xFFFE

Default polling DET signal timeout

## ◆ HAL_NFC_DE_RES_FAIL

#define HAL_NFC_DE_RES_FAIL 0x0003

failure

## ◆ HAL_NFC_DE_RES_NO_DATA

#define HAL_NFC_DE_RES_NO_DATA 0x0002

no new data from terminal

## ◆ HAL_NFC_DE_RES_OK

#define HAL_NFC_DE_RES_OK 0x0000

ok

## ◆ HAL_NFC_DE_RES_TIMEOUT

#define HAL_NFC_DE_RES_TIMEOUT 0x0001

timeout

## Typedef Documentation

## ◆ CALLBACK_NFC_DE_DATA_FROM_KERNEL

typedef KER_BOOL(KER_API * CALLBACK_NFC_DE_DATA_FROM_KERNEL) (KER_CTX_PARAM KER_VOID *pCallbackHandle, const KER_BYTE *pbtData, KER_INT16U usDataLen)

Callback type for data exchange.

Parameters

  [in] | pCallbackHandle | - callback context, obtained from Terminal Application, and stored by hal_register_callback (btCallbackType = KER_HAL_CALLBACK_HANDLE)
  [in] | pbtData | Buffer with data, obtained from icc
  [in] | usDataLen | pbtData buffer length

Returns
  KER_TRUE Success.
  KER_FALSE Failure.

This callback is optional. DE can be implemented by the hal itself

## ◆ CALLBACK_NFC_DE_DATA_FROM_TERMINAL

typedef KER_INT16U(KER_API * CALLBACK_NFC_DE_DATA_FROM_TERMINAL) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_INT16U usTimeout, KER_INT16U usParam, KER_VOID *pParam, KER_BYTE **ppbtData, KER_INT16U *pusDataLen)

Callback type for data exchange.

Parameters

  [in] | pCallbackHandle | - callback context, obtained from Terminal Application, and stored by hal_register_callback (btCallbackType = KER_HAL_CALLBACK_HANDLE)
  [in] | usTimeout | execution timeout in msec
  [in] | usParam | reserved
  [in,out] | pParam | reserved
  [out] | ppbtData | pointer to obtain buffer (in TLV format) with updated data
  [out] | pusDataLen | ppbtData referenced buffer length

Returns
  HAL_NFC_DE_RES_OK Success.
  HAL_NFC_DE_RES_TIMEOUT Timeout
  HAL_NFC_DE_RES_NO_DATA No new data from terminal
  Other - Failure.

This callback is optional. DE can be implemented by the hal itself This function is used for data exchage, second stage: get updated transaction data from terminal app.

Warning
  Memory for output buffer allocated insed the hal and should be released by CALLBACK_NFC_DE_DATA_RELEASE

## ◆ CALLBACK_NFC_DE_DATA_RELEASE

typedef KER_BOOL(KER_API * CALLBACK_NFC_DE_DATA_RELEASE) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_BYTE *pbtData)

Callback type for data exchange.

Parameters

  [in] | pCallbackHandle | - callback context, obtained from Terminal Application, and stored by hal_register_callback (btCallbackType = KER_HAL_CALLBACK_HANDLE)
  [in] | pbtData | pointer to memory, allocated by CALLBACK_NFC_DE_DATA_FROM_TERMINAL

Returns
  KER_TRUE Success.
  KER_FALSE Failure.

This callback is optional. DE can be implemented by the hal itself

## ◆ CALLBACK_NFC_DE_DATA_RELEASE_EX

typedef KER_BOOL(KER_API * CALLBACK_NFC_DE_DATA_RELEASE_EX) (KER_CTX_PARAM KER_VOID *pCallbackHandle, KER_BYTE *pbtData, KER_INT16U usDataLen)

Callback type for data exchange.

Parameters

  [in] | pCallbackHandle | - callback context, obtained from Terminal Application, and stored by hal_register_callback (btCallbackType = KER_HAL_CALLBACK_HANDLE)
  [in] | pbtData | pointer to memory, allocated by CALLBACK_NFC_DE_DATA_FROM_TERMINAL
  [in] | usDataLen | allocated buffer length

Returns
  KER_TRUE Success.
  KER_FALSE Failure.

This callback is optional. DE can be implemented by the hal itself

## Function Documentation

## ◆ hal_nfc_de_get_data_from_terminal()

KER_INT16U hal_nfc_de_get_data_from_terminal | ( | KER_CTX_PARAM KER_INT16U | usTimeout,
|  | KER_INT16U | usParam,
|  | KER_VOID * | pParam,
|  | KER_BYTE ** | ppbtData,
|  | KER_INT16U * | pusDataLen
| ) |  |

Data exchange: obtain updated transaction data from terminal.

Parameters

  [in] | usTimeout | execution timeout (in msec, or special values HAL_NFC_DE_DET_POLLING_TIMEOUT, HAL_NFC_DE_DEF_TIMEOUT)
  [in] | usParam | reserved
  [in,out] | pParam | reserved
  [out] | ppbtData | pointer to obtain buffer (in TLV format) with updated data
  [out] | pusDataLen | ppbtData referenced buffer length

Returns
  HAL_NFC_DE_RES_OK Success.
  HAL_NFC_DE_RES_TIMEOUT Timeout
  HAL_NFC_DE_RES_NO_DATA No new data from terminal
  Other - Failure.

This function is used for data exchage, second stage: get updated transaction data from terminal app.

Warning
  Memory for output buffer allocated insed the hal and should be released by hal_nfc_de_release

## ◆ hal_nfc_de_release()

KER_BOOL hal_nfc_de_release | ( | KER_CTX_PARAM KER_BYTE * | pbtData | ) |

Data exchange: release memory allocated by hal_nfc_de_get_data_from_terminal.

Parameters

  [in] | pbtData | pointer to memory, allocated by hal_nfc_de_get_data_from_terminal

Returns
  KER_TRUE Success.
  KER_FALSE Failure.

## ◆ hal_nfc_de_release_ex()

KER_BOOL hal_nfc_de_release_ex | ( | KER_CTX_PARAM KER_BYTE * | pbtData,
|  | KER_INT16U | usDataLen
| ) |  |

Data exchange: release memory allocated by hal_nfc_de_get_data_from_terminal.

This function is used to safe release memory.

Parameters

  [in] | pbtData | pointer to memory, allocated by hal_nfc_de_get_data_from_terminal
  [in] | usDataLen | allocated buffer length

Returns
  KER_TRUE Success.
  KER_FALSE Failure.

## ◆ hal_nfc_de_set_data_from_kernel()

KER_BOOL hal_nfc_de_set_data_from_kernel | ( | KER_CTX_PARAM const KER_BYTE * | pbtData,
|  | KER_INT16U | usDataLen
| ) |  |

Data exchange: pass data from kernel.

Parameters

  [in] | pbtData | Buffer with data, obtained from icc
  [in] | usDataLen | pbtData buffer length

Returns
  KER_TRUE Success.
  KER_FALSE Failure.

This function is used for data exchage, first stage: pass data obtained from icc to terminal.