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

Data Structures | Macros | Typedefs | Functions
HAL Initialization API

HAL Initialization Interface. More...

## Data Structures
struct | tag_HAL_NOTIFY_DATA_AID
| KER_HAL_NOTIFY_SELECTED_AID related data struct More...

## Macros
#define | KER_HAL_INIT(ConfigID, ConfigIDLen, KernelBinary, KernelBinaryLen) hal_init(KER_CTX_INIT ConfigID, ConfigIDLen, KernelBinary, KernelBinaryLen)
#define | KER_HAL_DEINIT() hal_deinit(KER_CTX_SINGLE)
#define | KER_HAL_START_TRAN() hal_start_tran(KER_CTX_SINGLE)
#define | KER_HAL_END_TRAN() hal_end_tran(KER_CTX_SINGLE)

## Typedefs
typedef struct tag_HAL_NOTIFY_DATA_AID | HAL_NOTIFY_DATA_AID
| KER_HAL_NOTIFY_SELECTED_AID related data struct

## Functions
KER_BOOL | hal_init (KER_CTX_INIT_PARAM const KER_VOID *pConfigID, KER_INT16U usConfigIDLen, const KER_CHAR *pchKernelModuleList, KER_INT16U usKernelModuleListLen)
| Performs HAL initialization. More...
KER_BOOL | hal_deinit (KER_CTX_SINGLE_PARAM)
| Performs HAL de-initialization. More...
KER_BOOL | hal_start_tran (KER_CTX_SINGLE_PARAM)
| Informs HAL about transaction start (to open new log, create new STAN, etc...) More...
KER_BOOL | hal_end_tran (KER_CTX_SINGLE_PARAM)
| Informs HAL about transaction end (to close curr log, etc...) More...
KER_BOOL | hal_calc_checksum (KER_CTX_PARAM KER_BYTE btType, KER_BYTE *pbtCheckSum, KER_INT16U *pusCheckSumLen, KER_INT16U usMaxSize)
| Pass checksums to the kernel. More...
KER_BOOL | hal_calc_checksum_ex (KER_CTX_PARAM KER_BYTE btType, const KER_CHAR *pchKernelModuleList, KER_INT16U usKernelModuleListLen, KER_BYTE *pbtCheckSum, KER_INT16U *pusCheckSumLen, KER_INT16U usMaxSize)
| Pass checksums to the kernel. More...
KER_BOOL | hal_register_callback (KER_CTX_PARAM KER_INT16U usCallbackType, KER_VOID *pCallback)
| Register callback to be used by HAL. At the moment use it only for backward compatibility to provide L1 interface as callback. More...
KER_BOOL | hal_notify (KER_CTX_PARAM KER_INT16U usNotifyType, const KER_VOID *pNotifyData, KER_INT16U usNotifyDataLen)
| Notifies HAL about some specific event. More...
KER_BOOL | hal_online_check (KER_CTX_SINGLE_PARAM)
| Checks HAL for unable to go online condition (for AmEx C-4). More...
#define | KER_HAL_CALLBACK_HANDLE 0x00
#define | KER_HAL_CALLBACK_EMVL1_RESET_CARD 0x10
#define | KER_HAL_CALLBACK_EMVL1_EXCH_APDU 0x11
#define | KER_HAL_CALLBACK_EMVL1_IFD_SERIAL 0x12
#define | KER_HAL_CALLBACK_CV_CHECK_CUST_CVM_CONDITION 0x20
#define | KER_HAL_CALLBACK_CV_CHECK_CUST_CVM 0x21
#define | KER_HAL_NOTIFY_SELECTED_AID 0x01
#define | KER_HAL_NOTIFY_SELECTED_KERNEL_ID 0x02

## Detailed Description

HAL Initialization Interface.

This functions should be implemented by terminal application

## Macro Definition Documentation

## ◆ KER_HAL_CALLBACK_CV_CHECK_CUST_CVM

#define KER_HAL_CALLBACK_CV_CHECK_CUST_CVM 0x21

Register check custom cvm callback (CALLBACK_CV_CHECK_CUST_CVM)

## ◆ KER_HAL_CALLBACK_CV_CHECK_CUST_CVM_CONDITION

#define KER_HAL_CALLBACK_CV_CHECK_CUST_CVM_CONDITION 0x20

Register check custom cvm condition callback (CALLBACK_CV_CHECK_CUST_CVM_CONDITION)

## ◆ KER_HAL_CALLBACK_EMVL1_EXCH_APDU

#define KER_HAL_CALLBACK_EMVL1_EXCH_APDU 0x11

Register EMV Level 1 exchange APDU callback (CALLBACK_EMVL1_EXCHANGE_APDU)

## ◆ KER_HAL_CALLBACK_EMVL1_IFD_SERIAL

#define KER_HAL_CALLBACK_EMVL1_IFD_SERIAL 0x12

Register EMV Level 1 request IFD serial number callback (CALLBACK_EMVL1_GET_IFD_SERIAL)

## ◆ KER_HAL_CALLBACK_EMVL1_RESET_CARD

#define KER_HAL_CALLBACK_EMVL1_RESET_CARD 0x10

Register EMV Level 1 reset card callback (CALLBACK_EMVL1_RESET_CARD)

## ◆ KER_HAL_CALLBACK_HANDLE

#define KER_HAL_CALLBACK_HANDLE 0x00

Set callback handle to be passed to other callbacks

## ◆ KER_HAL_DEINIT

#define KER_HAL_DEINIT | ( |  | ) | hal_deinit(KER_CTX_SINGLE)

\

## ◆ KER_HAL_END_TRAN

#define KER_HAL_END_TRAN | ( |  | ) | hal_end_tran(KER_CTX_SINGLE)

\

## ◆ KER_HAL_INIT

#define KER_HAL_INIT | ( |  | ConfigID,
|  |  | ConfigIDLen,
|  |  | KernelBinary,
|  |  | KernelBinaryLen
| ) |  | hal_init(KER_CTX_INIT ConfigID, ConfigIDLen, KernelBinary, KernelBinaryLen)

\

## ◆ KER_HAL_NOTIFY_SELECTED_AID

#define KER_HAL_NOTIFY_SELECTED_AID 0x01

AID selected event, pNotifyData contains HAL_NOTIFY_DATA_AID

## ◆ KER_HAL_NOTIFY_SELECTED_KERNEL_ID

#define KER_HAL_NOTIFY_SELECTED_KERNEL_ID 0x02

Kernel selected event, pNotifyData contains KER_INT16U with Kernel ID

## ◆ KER_HAL_START_TRAN

#define KER_HAL_START_TRAN | ( |  | ) | hal_start_tran(KER_CTX_SINGLE)

\

## Function Documentation

## ◆ hal_calc_checksum()

KER_BOOL hal_calc_checksum | ( | KER_CTX_PARAM KER_BYTE | btType,
|  | KER_BYTE * | pbtCheckSum,
|  | KER_INT16U * | pusCheckSumLen,
|  | KER_INT16U | usMaxSize
| ) |  |

Pass checksums to the kernel.

Parameters

  [in] | btType | Requested checksum type: 0x00 - Kernel checksum; 0x01 - Configuration checksum; 0x02 - Full Configuration checksum
  [out] | pbtCheckSum | Buffer to obtain claculated checksum
  [out] | pusCheckSumLen | Value to obtain claculated checksum length
  [in] | usMaxSize | Size of pchCheckSum Buffer

Returns
  KER_TRUE Success.
  KER_FALSE Failure.

## ◆ hal_calc_checksum_ex()

KER_BOOL hal_calc_checksum_ex | ( | KER_CTX_PARAM KER_BYTE | btType,
|  | const KER_CHAR * | pchKernelModuleList,
|  | KER_INT16U | usKernelModuleListLen,
|  | KER_BYTE * | pbtCheckSum,
|  | KER_INT16U * | pusCheckSumLen,
|  | KER_INT16U | usMaxSize
| ) |  |

Pass checksums to the kernel.

Parameters

  [in] | btType | Requested checksum type: 0x00 - Kernel checksum; 0x01 - Configuration checksum; 0x02 - Full Configuration checksum
  [in] | pchKernelModuleList | Buffer with a list of module names to include in kernel checksum, each terminated with a zero character, and an extra zero character in the end (optional)
  [in] | usKernelModuleListLen | pchKernelModuleList buffer length
  [out] | pbtCheckSum | Buffer to obtain claculated checksum
  [out] | pusCheckSumLen | Value to obtain claculated checksum length
  [in] | usMaxSize | Size of pchCheckSum Buffer

Returns
  KER_TRUE Success.
  KER_FALSE Failure.

## ◆ hal_deinit()

KER_BOOL hal_deinit | ( | KER_CTX_SINGLE_PARAM |  | ) |

Performs HAL de-initialization.

Returns
  KER_TRUE Success.
  KER_FALSE Failure.

## ◆ hal_end_tran()

KER_BOOL hal_end_tran | ( | KER_CTX_SINGLE_PARAM |  | ) |

Informs HAL about transaction end (to close curr log, etc...)

Returns
  KER_TRUE Success.
  KER_FALSE Failure.

## ◆ hal_init()

KER_BOOL hal_init | ( | KER_CTX_INIT_PARAM const KER_VOID * | pConfigID,
|  | KER_INT16U | usConfigIDLen,
|  | const KER_CHAR * | pchKernelModuleList,
|  | KER_INT16U | usKernelModuleListLen
| ) |  |

Performs HAL initialization.

Parameters

  [in] | pConfigID | Buffer with configuration ID obtained from Terminal Application (in HAL recognized format)
  [in] | usConfigIDLen | pConfigID buffer length
  [in] | pchKernelModuleList | Buffer with a list of module names to include in kernel checksum, each terminated with a zero character, and an extra zero character in the end
  [in] | usKernelModuleListLen | pchKernelModuleList buffer length

Returns
  KER_TRUE Success.
  KER_FALSE Failure.

Terminal Application should obtain context data reference (if context usage configured) and pass it to all other kernel functions

Warning
  Allocated context should be released by hal_deinit.

## ◆ hal_notify()

KER_BOOL hal_notify | ( | KER_CTX_PARAM KER_INT16U | usNotifyType,
|  | const KER_VOID * | pNotifyData,
|  | KER_INT16U | usNotifyDataLen
| ) |  |

Notifies HAL about some specific event.

KER_HAL_NOTIFY_SELECTED_AID or KER_HAL_NOTIFY_SELECTED_KERNEL_ID notification could be used to keep selected AID or Kernel ID to extract AID-related or Kernel-related config later...

Parameters

  [in] | usNotifyType | Event type (KER_HAL_NOTIFY_SELECTED_AID, etc...)
  [in] | pNotifyData | Event related data
  [in] | usNotifyDataLen | pNotifyData data length

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

## ◆ hal_online_check()

KER_BOOL hal_online_check | ( | KER_CTX_SINGLE_PARAM |  | ) |

Checks HAL for unable to go online condition (for AmEx C-4).

Returns
  KER_TRUE Online available or Online state is unknown (default).
  KER_FALSE Unable to go online condition.

## ◆ hal_register_callback()

KER_BOOL hal_register_callback | ( | KER_CTX_PARAM KER_INT16U | usCallbackType,
|  | KER_VOID * | pCallback
| ) |  |

Register callback to be used by HAL. At the moment use it only for backward compatibility to provide L1 interface as callback.

Parameters

  [in] | usCallbackType | Callback type (KER_HAL_CALLBACK_HANDLE, KER_HAL_CALLBACK_EMVL1_RESET_CARD, etc...)
  [in] | pCallback | callback handle/pointer

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.

## ◆ hal_start_tran()

KER_BOOL hal_start_tran | ( | KER_CTX_SINGLE_PARAM |  | ) |

Informs HAL about transaction start (to open new log, create new STAN, etc...)

Returns
  KER_TRUE Success.
  KER_FALSE Failure.