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

hal_config.h
Go to the documentation of this file.
1 #ifndef HAL_CONFIG_H
2 #define HAL_CONFIG_H
3
4 /* ********************* HAL terminal configuration API declaration ************************ */
8 /* ***************************************************************************************** */
9
10 /* ***************************************************************************************** */
17 /* ***************************************************************************************** */
18
19 /* ********************************* HAL Config marcos ************************************* */
24 /* ***************************************************************************************** */
25 #ifndef KER_IS_CASH_TRAN
27 #define KER_IS_CASH_TRAN(TranType)(hal_cfg_get_is_tran_cash(KER_CTX TranType))
28 #endif
29 #ifndef KER_IS_SALE_TRAN
31 #define KER_IS_SALE_TRAN(TranType)(hal_cfg_get_is_tran_sale(KER_CTX TranType))
32 #endif
33 #ifndef KER_IS_CASHBACK_TRAN
35 #define KER_IS_CASHBACK_TRAN(TranType)(hal_cfg_get_is_tran_cashback(KER_CTX TranType))
36 #endif
37 #ifndef KER_IS_MANUAL_CASH_TRAN
39 #define KER_IS_MANUAL_CASH_TRAN(TranType)(hal_cfg_get_is_tran_manual_cash(KER_CTX TranType))
40 #endif
41 #ifndef KER_IS_REFUND_TRAN
43 #define KER_IS_REFUND_TRAN(TranType)(hal_cfg_get_is_tran_refund(KER_CTX TranType))
44 #endif
45 #ifndef KER_IS_APPROVED_ONLINE
47 #define KER_IS_APPROVED_ONLINE(Arc,ArcLen)(hal_cfg_get_is_approved_online(KER_CTX Arc, ArcLen))
48 #endif
49 #ifndef KER_IS_REFERRAL_ONLINE
51 #define KER_IS_REFERRAL_ONLINE(Arc,ArcLen)(hal_cfg_get_is_referral_online(KER_CTX Arc, ArcLen))
52 #endif
53 /* ***************************************************************************************** */
56 /* ***************************** hal_cfg_get_supp_app_list ********************************* */
70 extern KER_BOOL hal_cfg_get_supp_app_list(KER_CTX_PARAM KER_TLV** ppSuppCandList);
71
72 /* ***************************** hal_cfg_get_next_supp_app ********************************* */
84 extern KER_TLV* hal_cfg_get_next_supp_app(KER_CTX_PARAM const KER_TLV* pCurrSuppAID, const KER_TLV* pLastCandAddedToCL);
85
86 /* ******************************** hal_cfg_cl_postprocess ********************************* */
107 extern KER_RES hal_cfg_cl_postprocess(KER_CTX_PARAM KER_TLV** ppCandidateList, const KER_TLV* pBlockedAppList, KER_BOOL bForReselect);
108
109 /* ****************************** hal_cfg_lang_autoselect ********************************** */
120 extern KER_BYTE hal_cfg_lang_autoselect(KER_CTX_PARAM const KER_BYTE* pbtIccSuppLang, KER_BYTE btIccSuppLangLength, KER_BYTE* pbtSelectedLang, KER_BYTE btSelectedLangSize);
121
122 /* ********************************* hal_cfg_get_config ************************************ */
139 extern KER_BOOL hal_cfg_get_config(KER_CTX_PARAM const KER_BYTE* pbtAID, KER_INT16U usAIDLen, KER_TLV** ppConfigList);
140
141 /* ******************************* hal_cfg_get_tran_config ********************************* */
159 extern KER_BOOL hal_cfg_get_tran_config(KER_CTX_PARAM const KER_BYTE* pbtAID, KER_INT16U usAIDLen, const KER_TLV* pTranDataList, KER_TLV** ppConfigList);
160
161 /* ****************************** hal_cfg_get_config_by_tag ******************************** */
182 extern KER_BOOL hal_cfg_get_config_by_tag(KER_CTX_PARAM const KER_BYTE* pbtAID, KER_INT16U usAIDLen, const KER_BYTE* pbtTag, KER_BYTE btTagLen, KER_BYTE* pbtValue, KER_INT16U* pusValueLen, KER_INT16U usMaxLen);
183
184 /* ********** ID used in hal_cfg_get_config_by_id and hal_cfg_set_config_by_id ************* */
193 #define KER_CFG_ID_COMPARE_TRACK2_MASK 0x0101
195 #define KER_CFG_COMPARE_TRACK2_MASK_PAN 0x01
197 #define KER_CFG_COMPARE_TRACK2_MASK_EXP_DATE 0x02
198
204 #define KER_CFG_ID_OVERRIDE_9C_FOR_CVM 0x0102
205
211 #define KER_CFG_ID_SCRIPT_RESULTS 0x0103
212
218 #define KER_CFG_ID_OVERRIDE_9C_FOR_RESTR 0x0104
219
225 #define KER_CFG_ID_OVERRIDE_9C_PER_AID 0x0105
226
232 #define KER_CFG_ID_APP_CONFIG_ENTRY_ID 0x0106
233
239 #define KER_CFG_ID_DISABLE_PSE 0x0107
240
246 #define KER_CFG_ID_OVERRIDE_8A 0x0108
247
253 #define KER_CFG_ID_ASI 0x0201
254
261 #define KER_CFG_ID_DEF_APP_LABEL 0x0202
262
269 #define KER_CFG_ID_LOW_APP_SUPP_VER_RANGE 0x0203
270
277 #define KER_CFG_ID_HIGH_APP_SUPP_VER_RANGE 0x0204
278
284 #define KER_CFG_ID_TAC_DENIAL 0x0205
285
291 #define KER_CFG_ID_TAC_ONLINE 0x0206
292
298 #define KER_CFG_ID_TAC_DEFAULT 0x0207
299
305 #define KER_CFG_ID_DEFAULT_TDOL 0x0208
306
312 #define KER_CFG_ID_DEFAULT_DDOL 0x0209
313
324 #define KER_CFG_ID_CDA_MODE 0x020A
325
331 #define KER_CFG_ID_OFFLINE_MODE 0x020B
332
338 #define KER_CFG_ID_SKIP_PIN_GET_DATA 0x020C
339
345 #define KER_CFG_ID_TERM_TRAN_LOG_DATA 0x020D
346
352 #define KER_CFG_ID_TERM_TRAN_LOG_INDEX 0x020E
353
359 #define KER_CFG_ID_TERM_RAND_SEL_TARGET_PERCENTAGE 0x020F
360
366 #define KER_CFG_ID_TERM_RAND_SEL_MAX_TARGET_PERCENTAGE 0x0210
367
373 #define KER_CFG_ID_TERM_RAND_SEL_TRESHOLD 0x0211
374
380 #define KER_CFG_ID_AEC 0x0212
381
387 #define KER_CFG_ID_TAED 0x0213
388
395 #define KER_CFG_ID_CARDHOLDER_CONFIRMATION_SUPP 0x0301
396
404 #define KER_CFG_ID_FORCE_FIRST_APP_SELECTION 0x0302
405
411 #define KER_CFG_ID_DEF_APP_LABEL_USAGE 0x0303
412
423 #define KER_CFG_ID_TRAN_CHAINING_OPTIONS 0x0304
425 #define KER_CFG_TR_CHAINING_FULL_RESTART 0x00
426 #define KER_CFG_TR_CHAINING_REUSE_FINAL_CL 0x01
427 #define KER_CFG_TR_CHAINING_REUSE_INITIAL_CL 0x02
435 #define KER_CFG_ID_PIN_ENTRY_BYPASS 0x0305
436
443 #define KER_CFG_ID_ISS_SCRIPTS_SIZE_LIMIT 0x0306
444
445 /* *** ID 0x0307 - 0x3FF - reserved *** */
446
447 /* ****************************** hal_cfg_get_config_by_id ********************************* */
467 extern KER_BOOL hal_cfg_get_config_by_id(KER_CTX_PARAM const KER_BYTE* pbtAID, KER_INT16U usAIDLen, KER_INT16U usID, KER_BYTE* pbtValue, KER_INT16U* pusValueLen, KER_INT16U usMaxLen);
468
469 /* ****************************** hal_cfg_set_config_by_id ********************************* */
483 extern KER_BOOL hal_cfg_set_config_by_id(KER_CTX_PARAM KER_INT16U usID, const KER_BYTE* pbtValue, KER_INT16U usValueLen);
484
485 /* **************************** hal_cfg_get_tran_config_by_id ****************************** */
507 extern KER_BOOL hal_cfg_get_tran_config_by_id(KER_CTX_PARAM KER_TRAN* pTran, const KER_BYTE* pbtAID, KER_INT16U usAIDLen, const KER_TLV* pTranDataList, KER_INT16U usID, KER_BYTE* pbtValue, KER_INT16U* pusValueLen, KER_INT16U usMaxLen);
508
509 /* **************************** hal_cfg_get_custom_tag_by_id ******************************* */
524 extern KER_BOOL hal_cfg_get_custom_tag_by_id(KER_CTX_PARAM KER_INT16U usID, KER_BYTE* pbtValue, KER_INT16U* pusValueLen, KER_INT16U usMaxLen);
525
526 /* **************************** hal_cfg_get_id_by_custom_tag ******************************* */
538 extern KER_INT16U hal_cfg_get_id_by_custom_tag(KER_CTX_PARAM const KER_BYTE* pbtTag, KER_INT16U usTagLen);
539
540 /* **************************** hal_cfg_get_is_tran_cash ******************************* */
550 extern KER_BOOL hal_cfg_get_is_tran_cash(KER_CTX_PARAM KER_BYTE btTranType);
551
552 /* **************************** hal_cfg_get_is_tran_sale ******************************* */
562 extern KER_BOOL hal_cfg_get_is_tran_sale(KER_CTX_PARAM KER_BYTE btTranType);
563
564 /* **************************** hal_cfg_get_is_tran_cashback ******************************* */
574 extern KER_BOOL hal_cfg_get_is_tran_cashback(KER_CTX_PARAM KER_BYTE btTranType);
575
576 /* *************************** hal_cfg_get_is_tran_manual_cash ***************************** */
586 extern KER_BOOL hal_cfg_get_is_tran_manual_cash(KER_CTX_PARAM KER_BYTE btTranType);
587
588 /* ***************************** hal_cfg_get_is_tran_refund ******************************** */
598 extern KER_BOOL hal_cfg_get_is_tran_refund(KER_CTX_PARAM KER_BYTE btTranType);
599
600 /* **************************** hal_cfg_get_is_approved_online ******************************* */
611 extern KER_BOOL hal_cfg_get_is_approved_online(KER_CTX_PARAM const KER_BYTE* pbtARC, KER_INT16U usARCLen);
612
613 /* *************************** hal_cfg_get_is_referral_online ****************************** */
624 extern KER_BOOL hal_cfg_get_is_referral_online(KER_CTX_PARAM const KER_BYTE* pbtARC, KER_INT16U usARCLen);
625
626 /* ************************** hal_cfg_add_tran_to_term_log_file **************************** */
638 extern KER_BOOL hal_cfg_add_tran_to_term_log_file(KER_CTX_PARAM const KER_BYTE* pbtTLV, KER_INT16U usTLVLen);
639
640 /* ********************** hal_cfg_get_tran_amount_from_term_log_file *********************** */
654 extern KER_BOOL hal_cfg_get_tran_amount_from_term_log_file(KER_CTX_PARAM const KER_BYTE* pbtTLV, KER_INT16U usTLVLen, KER_INT32U* pulPrevTranAmountHI, KER_INT32U* pulPrevTranAmountLO);
655
656 /* ***************************** hal_cfg_check_exception_file ****************************** */
667 extern KER_BOOL hal_cfg_check_exception_file(KER_CTX_PARAM const KER_BYTE* pbtTLV, KER_INT16U usTLVLen);
668
669 #endif /* HAL_CONFIG_H */
KER_BOOL
KER_INT8U KER_BOOL
Definition: emv_platform.h:67
KER_BYTE
uint8_t KER_BYTE
Definition: emv_platform.h:70
KER_RES
KER_INT16U KER_RES
Definition: emv_platform.h:68
KER_INT32U
unsigned int KER_INT32U
Definition: emv_platform.h:63
KER_INT16U
unsigned short KER_INT16U
Definition: emv_platform.h:61
hal_cfg_check_exception_file
KER_BOOL hal_cfg_check_exception_file(KER_CTX_PARAM const KER_BYTE *pbtTLV, KER_INT16U usTLVLen)
Checks if card appears in terminal exception file (EMV Book 4 6.3.5)
hal_cfg_get_config
KER_BOOL hal_cfg_get_config(KER_CTX_PARAM const KER_BYTE *pbtAID, KER_INT16U usAIDLen, KER_TLV **ppConfigList)
Provides common terminal configuration for Kernel.
hal_cfg_get_supp_app_list
KER_BOOL hal_cfg_get_supp_app_list(KER_CTX_PARAM KER_TLV **ppSuppCandList)
Provides terminal supported applications list for Kernel.
hal_cfg_get_tran_amount_from_term_log_file
KER_BOOL hal_cfg_get_tran_amount_from_term_log_file(KER_CTX_PARAM const KER_BYTE *pbtTLV, KER_INT16U usTLVLen, KER_INT32U *pulPrevTranAmountHI, KER_INT32U *pulPrevTranAmountLO)
Add to transaction log to prevent split sales.
hal_cfg_get_tran_config
KER_BOOL hal_cfg_get_tran_config(KER_CTX_PARAM const KER_BYTE *pbtAID, KER_INT16U usAIDLen, const KER_TLV *pTranDataList, KER_TLV **ppConfigList)
Provides terminal configuration specific for AID-Transaction data combination for Kernel.
hal_cfg_get_config_by_tag
KER_BOOL hal_cfg_get_config_by_tag(KER_CTX_PARAM const KER_BYTE *pbtAID, KER_INT16U usAIDLen, const KER_BYTE *pbtTag, KER_BYTE btTagLen, KER_BYTE *pbtValue, KER_INT16U *pusValueLen, KER_INT16U usMaxLen)
Provides common terminal configuration for tag requested.
hal_cfg_get_is_tran_cash
KER_BOOL hal_cfg_get_is_tran_cash(KER_CTX_PARAM KER_BYTE btTranType)
Check transaction type (9C) for cash tran (cash or cash disbursement at POS)
hal_cfg_add_tran_to_term_log_file
KER_BOOL hal_cfg_add_tran_to_term_log_file(KER_CTX_PARAM const KER_BYTE *pbtTLV, KER_INT16U usTLVLen)
Add to transaction log to prevent split sales.
hal_cfg_get_tran_config_by_id
KER_BOOL hal_cfg_get_tran_config_by_id(KER_CTX_PARAM KER_TRAN *pTran, const KER_BYTE *pbtAID, KER_INT16U usAIDLen, const KER_TLV *pTranDataList, KER_INT16U usID, KER_BYTE *pbtValue, KER_INT16U *pusValueLen, KER_INT16U usMaxLen)
Provides terminal configuration specific for AID-Transaction data combination which have no emv tag a...
hal_cfg_get_config_by_id
KER_BOOL hal_cfg_get_config_by_id(KER_CTX_PARAM const KER_BYTE *pbtAID, KER_INT16U usAIDLen, KER_INT16U usID, KER_BYTE *pbtValue, KER_INT16U *pusValueLen, KER_INT16U usMaxLen)
Provides terminal configuration which have no emv tag assinged by ID.
hal_cfg_get_is_tran_cashback
KER_BOOL hal_cfg_get_is_tran_cashback(KER_CTX_PARAM KER_BYTE btTranType)
Check transaction type (9C) for cashback.
hal_cfg_cl_postprocess
KER_RES hal_cfg_cl_postprocess(KER_CTX_PARAM KER_TLV **ppCandidateList, const KER_TLV *pBlockedAppList, KER_BOOL bForReselect)
Custom candidate list postprocessing.
hal_cfg_get_id_by_custom_tag
KER_INT16U hal_cfg_get_id_by_custom_tag(KER_CTX_PARAM const KER_BYTE *pbtTag, KER_INT16U usTagLen)
Remapp custom tag to configuration ID.
hal_cfg_lang_autoselect
KER_BYTE hal_cfg_lang_autoselect(KER_CTX_PARAM const KER_BYTE *pbtIccSuppLang, KER_BYTE btIccSuppLangLength, KER_BYTE *pbtSelectedLang, KER_BYTE btSelectedLangSize)
Ckecks for match between ICC and Terminal supported languages and makes autoselection.
hal_cfg_get_is_tran_sale
KER_BOOL hal_cfg_get_is_tran_sale(KER_CTX_PARAM KER_BYTE btTranType)
Check transaction type (9C) for goods and services.
hal_cfg_set_config_by_id
KER_BOOL hal_cfg_set_config_by_id(KER_CTX_PARAM KER_INT16U usID, const KER_BYTE *pbtValue, KER_INT16U usValueLen)
Keeps trerminal params in "scratch pad".
hal_cfg_get_is_referral_online
KER_BOOL hal_cfg_get_is_referral_online(KER_CTX_PARAM const KER_BYTE *pbtARC, KER_INT16U usARCLen)
Check online result by ARC (for referral request)
hal_cfg_get_is_tran_refund
KER_BOOL hal_cfg_get_is_tran_refund(KER_CTX_PARAM KER_BYTE btTranType)
Check transaction type (9C) for refund (0x20)
hal_cfg_get_is_tran_manual_cash
KER_BOOL hal_cfg_get_is_tran_manual_cash(KER_CTX_PARAM KER_BYTE btTranType)
Check transaction type (9C) for manual cash tran (0x17)
hal_cfg_get_next_supp_app
KER_TLV * hal_cfg_get_next_supp_app(KER_CTX_PARAM const KER_TLV *pCurrSuppAID, const KER_TLV *pLastCandAddedToCL)
Proceed to the next supported app in the list.
hal_cfg_get_is_approved_online
KER_BOOL hal_cfg_get_is_approved_online(KER_CTX_PARAM const KER_BYTE *pbtARC, KER_INT16U usARCLen)
Check online result by ARC.
hal_cfg_get_custom_tag_by_id
KER_BOOL hal_cfg_get_custom_tag_by_id(KER_CTX_PARAM KER_INT16U usID, KER_BYTE *pbtValue, KER_INT16U *pusValueLen, KER_INT16U usMaxLen)
Remapp terminal configuration id to custom tag.
KER_CTX_PARAM
#define KER_CTX_PARAM
Definition: emv_context.h:53
KER_TRAN
struct tag_KER_TRAN KER_TRAN
Kernel internal transaction data structure.
Definition: emv_data.h:251
tag_KER_TLV
TLV container structure.
Definition: emv_data.h:63