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

hal_nfcl1.h
Go to the documentation of this file.
1 #ifndef HAL_NFCL1_H
2 #define HAL_NFCL1_H
3
4 /* *************************** HAL NFC Level1 API declaration ****************************** */
8 /* ***************************************************************************************** */
9
10 /* ***************************************************************************************** */
17 /* ***************************************************************************************** */
18
19 /* *********************************** NFCL1 marcos **************************************** */
24 /* ***************************************************************************************** */
25 #define KER_NFCL1_LE_MAX 0x0000
26 #define KER_NFCL1_LE_NULL 0xFFFF
28 #define KER_NFCL1_APDU_CASE1 0x01
29 #define KER_NFCL1_APDU_CASE2 0x02
30 #define KER_NFCL1_APDU_CASE3 0x03
31 #define KER_NFCL1_APDU_CASE4 0x04
33 #define KER_NFCL1_PHISICAL_CARD_TYPE_DEFAULT 0x0000
34 #define KER_NFCL1_PHISICAL_CARD_TYPE_NONE 0x0000
35 #define KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_A 0x0001
36 #define KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_B 0x0002
37 #define KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_4_A 0x0004
38 #define KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_4_B 0x0008
39 #define KER_NFCL1_PHISICAL_CARD_TYPE_MIFARE_A_STD 0x0010
40 #define KER_NFCL1_PHISICAL_CARD_TYPE_MIFARE_A_UL 0x0020
41 #define KER_NFCL1_PHISICAL_CARD_TYPE_ISO14443_AND_MIFARE 0x0040
42 #define KER_NFCL1_PHISICAL_CARD_TYPE_UNKNOWN 0x8000
44 #define KER_NFCL1_PU_POLLING_TIMEOUT 0xFFFFFFFE
46 #define KER_NFCL1_POLLING_TIMEOUT 0xFFFE
47 #define KER_NFCL1_DEF_TIMEOUT 0xFFFF
49 #define KER_NFCL1_PU_RES_TIMEOUT 0xFD01
50 #define KER_NFCL1_PU_RES_COLLISION 0xFD02
51 #define KER_NFCL1_PU_RES_COMM_ERROR 0xFD03
52 #define KER_NFCL1_PU_RES_FATAL_ERROR 0xFD04
54 #define KER_NFCL1_CR_RES_TIMEOUT 0xFD0A
55 #define KER_NFCL1_CR_HW_ERROR 0xFD0B
57 #define KER_NFCL1_RES_TIMEOUT 0xFE01
58 #define KER_NFCL1_RES_PENDING 0xFE02
59 #define KER_NFCL1_RES_TRANSMISSION 0xFE03
60 #define KER_NFCL1_RES_PROTOCOL 0xFE04
61 #define KER_NFCL1_RES_HW_ERROR 0xFE05
62 #define KER_NFCL1_RES_UNKNOWN 0xFE0F
64 /* ***************************************************************************************** */
67 /* ******************************* hal_nfcl1_exchange_apdu ********************************* */
86 extern KER_BOOL hal_nfcl1_exchange_apdu(KER_CTX_PARAM KER_BYTE btApduCase,
87 KER_BYTE btCLA, KER_BYTE btINS, KER_BYTE btP1, KER_BYTE btP2,
88 KER_INT16U usLc, const KER_BYTE *pbtDataIn, KER_INT16U usLe,
89 KER_BYTE *pbtDataOut, KER_INT16U *pusDataOut, KER_INT16U usDataOutSize, KER_INT16U *pusSW1SW2);
90
91 /* ******************************* hal_nfcl1_send_c_apdu ********************************* */
106 extern KER_BOOL hal_nfcl1_send_c_apdu(KER_CTX_PARAM KER_BYTE btApduCase,
107 KER_BYTE btCLA, KER_BYTE btINS, KER_BYTE btP1, KER_BYTE btP2,
108 KER_INT16U usLc, const KER_BYTE *pbtDataIn, KER_INT16U usLe);
109
110 /* ******************************* hal_nfcl1_recv_r_apdu ********************************* */
128 extern KER_RES hal_nfcl1_recv_r_apdu(KER_CTX_PARAM KER_INT16U usTimeout, KER_BYTE *pbtDataOut, KER_INT16U *pusDataOut, KER_INT16U usDataOutSize,
129 KER_INT16U *pusSW1SW2, KER_INT32U *pulExecutionTime);
130
131 /* ********************************* hal_nfcl1_card_poll *********************************** */
157 extern KER_RES hal_nfcl1_card_poll(KER_CTX_PARAM KER_INT32U ulTimeout, KER_INT16U* pusCardType, KER_BYTE* pbtUID, KER_INT16U* pusUIDLen);
158
159 /* ******************************** hal_nfcl1_get_card_info *********************************** */
178 extern KER_BOOL hal_nfcl1_get_card_info(KER_CTX_PARAM KER_INT16U* pusCardType, KER_BYTE* pbtUID, KER_INT16U* pusUIDLen);
179
180 /* *************************** hal_nfcl1_card_removal_procedure **************************** */
190 extern KER_RES hal_nfcl1_card_removal_procedure(KER_CTX_PARAM KER_INT32U ulTimeout);
191
192 /* ********************************* hal_nfcl1_field_off *********************************** */
199 extern KER_BOOL hal_nfcl1_field_off(KER_CTX_SINGLE_PARAM);
200
201 /* *************************** hal_nfcl1_reset_operation_field ***************************** */
208 extern KER_BOOL hal_nfcl1_reset_operation_field(KER_CTX_SINGLE_PARAM);
209
210 /* ******************************** hal_nfcl1_get_reader_serial_number *********************************** */
220 extern KER_BOOL hal_nfcl1_get_reader_serial_number(KER_CTX_PARAM KER_CHAR* pchData, KER_BYTE* pbtDataLen);
221
222
223 /* ****************************** CALLBACK_NFCL1_EXCHANGE_APDU ***************************** */
244 typedef KER_BOOL (KER_API *CALLBACK_NFCL1_EXCHANGE_APDU)(KER_CTX_PARAM KER_VOID* pCallbackHandle, KER_BYTE btApduCase,
245 KER_BYTE btCLA, KER_BYTE btINS, KER_BYTE btP1, KER_BYTE btP2,
246 KER_INT16U usLc, const KER_BYTE *pbtDataIn, KER_INT16U usLe,
247 KER_BYTE *pbtDataOut, KER_INT16U *pusDataOut, KER_INT16U usDataOutSize, KER_INT16U *pusSW1SW2);
248
249 /* ****************************** CALLBACK_NFCL1_SEND_C_APDU ***************************** */
266 typedef KER_BOOL(KER_API *CALLBACK_NFCL1_SEND_C_APDU)(KER_CTX_PARAM KER_VOID* pCallbackHandle, KER_BYTE btApduCase,
267 KER_BYTE btCLA, KER_BYTE btINS, KER_BYTE btP1, KER_BYTE btP2,
268 KER_INT16U usLc, const KER_BYTE *pbtDataIn, KER_INT16U usLe);
269
270 /* ****************************** CALLBACK_NFCL1_RECV_R_APDU ***************************** */
289 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);
290
291 /* ****************************** CALLBACK_NFCL1_CARD_FIELD_OFF ***************************** */
300 typedef KER_BOOL(KER_API *CALLBACK_NFCL1_CARD_FIELD_OFF)(KER_CTX_PARAM KER_VOID* pCallbackHandle);
301
302 /* ****************************** CALLBACK_NFCL1_CARD_POLL ***************************** */
323 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);
324
325 /* ****************************** CALLBACK_NFCL1_GET_CARD_INFO ***************************** */
345 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);
346
347 /* ******************************** CALLBACK_NFCL1_CARD_REMOVAL_PROCEDURE *********************************** */
359 typedef KER_RES(KER_API* CALLBACK_NFCL1_CARD_REMOVAL_PROCEDURE)(KER_CTX_PARAM KER_VOID* pCallbackHandle, KER_INT32U ulTimeout);
360
361 /* ******************************** CALLBACK_NFCL1_RESET_OPERATION_FIELD *********************************** */
369 typedef KER_BOOL(KER_API* CALLBACK_NFCL1_RESET_OPERATION_FIELD)(KER_CTX_PARAM KER_VOID* pCallbackHandle);
370
371 /* ****************************** CALLBACK_NFCL1_GET_READER_SERIAL_NUMBER ***************************** */
384 typedef KER_BOOL(KER_API *CALLBACK_NFCL1_GET_READER_SERIAL_NUMBER)(KER_CTX_PARAM KER_VOID* pCallbackHandle, KER_CHAR* pchData, KER_BYTE* pbtDataLen);
385
386 /* ****************************** CALLBACK_NFCL1_GET_READER_TYPE_ID ***************************** */
397 typedef KER_BOOL(KER_API* CALLBACK_NFCL1_GET_READER_TYPE_ID)(KER_CTX_PARAM KER_VOID* pCallbackHandle, KER_CHAR* pchData, KER_INT16U* pbtDataLen);
398
399 #endif /* HAL_NFCL1_H */
KER_VOID
void KER_VOID
Definition: emv_platform.h:66
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
KER_CHAR
char KER_CHAR
Definition: emv_platform.h:65
KER_CTX_PARAM
#define KER_CTX_PARAM
Definition: emv_context.h:53
KER_CTX_SINGLE_PARAM
#define KER_CTX_SINGLE_PARAM
Definition: emv_context.h:58
CALLBACK_NFCL1_GET_CARD_INFO
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.
Definition: hal_nfcl1.h:345
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.
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.
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.
CALLBACK_NFCL1_RECV_R_APDU
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.
Definition: hal_nfcl1.h:289
hal_nfcl1_field_off
KER_BOOL hal_nfcl1_field_off(KER_CTX_SINGLE_PARAM)
PCD field off request.
CALLBACK_NFCL1_GET_READER_SERIAL_NUMBER
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.
Definition: hal_nfcl1.h:384
CALLBACK_NFCL1_CARD_REMOVAL_PROCEDURE
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.
Definition: hal_nfcl1.h:359
CALLBACK_NFCL1_SEND_C_APDU
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.
Definition: hal_nfcl1.h:266
hal_nfcl1_card_removal_procedure
KER_RES hal_nfcl1_card_removal_procedure(KER_CTX_PARAM KER_INT32U ulTimeout)
Performs EMV L1 card removal procedure.
CALLBACK_NFCL1_CARD_POLL
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.
Definition: hal_nfcl1.h:323
hal_nfcl1_reset_operation_field
KER_BOOL hal_nfcl1_reset_operation_field(KER_CTX_SINGLE_PARAM)
Reset operation field.
CALLBACK_NFCL1_CARD_FIELD_OFF
KER_BOOL(KER_API * CALLBACK_NFCL1_CARD_FIELD_OFF)(KER_CTX_PARAM KER_VOID *pCallbackHandle)
Callback type to power down the RF card.
Definition: hal_nfcl1.h:300
CALLBACK_NFCL1_GET_READER_TYPE_ID
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.
Definition: hal_nfcl1.h:397
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.
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.
CALLBACK_NFCL1_EXCHANGE_APDU
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.
Definition: hal_nfcl1.h:244
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.
CALLBACK_NFCL1_RESET_OPERATION_FIELD
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.
Definition: hal_nfcl1.h:369