APDU reader/writer for Type 4 Tag communication.
More...
|
#define | SELECT_BY_FILE_ID 0x000C |
| Select by file identifier, first or only occurence.
|
|
#define | SELECT_BY_NAME 0x0400 |
| Select by name, first or only occurence.
|
|
APDU reader/writer for Type 4 Tag communication.
#define VERIFY_RAPDU_SUCCESS |
( |
|
P_RAPDU | ) |
|
Value:
{ \
return NRF_ERROR_NOT_FOUND; \
} \
{ \
return NRF_ERROR_INTERNAL; \
}
Macro for verifying R-APDU descriptor status.
This macro verifies R-APDU descriptor status. It will cause the exterior function to return nrf_error translated from R-APDU status, if the status is not equal to RAPDU_STATUS_CMD_COMPLETED.
- Parameters
-
[in] | P_RAPDU | Pointer to R-APDU descriptor. |
- Return values
-
NRF_ERROR_NOT_FOUND | If C-APDU select command could not find the selected item. |
NRF_ERROR_INTERNAL | Unknown R-APDU error. |
Possible instruction codes in C-APDU.
Enumerator |
---|
NFC_T4T_CAPDU_SELECT_INS |
Code used for selecting EF or NDEF application.
|
NFC_T4T_CAPDU_READ_INS |
Code used for selecting EF or NDEF application.
|
NFC_T4T_CAPDU_UPDATE_INS |
Code used for selecting EF or NDEF application.
|
Function for clearing C-APDU descriptor and restoring its default values.
- Parameters
-
[in] | p_cmd_apdu | Pointer to C-APDU descriptor. |
Function for encoding C-APDU.
This function encodes C-APDU according to the provided descriptor.
- Parameters
-
[in] | p_cmd_apdu | Pointer to the C-APDU descriptor. |
[out] | p_raw_data | Pointer to the buffer with encoded C-APDU. |
[in,out] | p_len | Size of the available memory for the C-APDU as input. Size of the generated C-APDU as output. |
- Return values
-
NRF_SUCCESS | If C-APDU was encoded successfully. |
NRF_ERROR_NO_MEM | If the predicted C-APDU size is bigger than the provided buffer space. |
NRF_ERROR_INVALID_PARAM | If C-APDU descriptor is invalid. |
NRF_ERROR_NULL | If any passed argument is NULL. |
Function for clearing R-APDU descriptor and restoring its default values.
- Parameters
-
[in] | p_resp_apdu | Pointer to R-APDU descriptor. |
Function for decoding R-APDU.
This function decodes buffer with encoded R-APDU and stores results in the R-APDU descriptor.
- Parameters
-
[out] | p_resp_apdu | Pointer to the R-APDU descriptor. |
[in] | p_raw_data | Pointer to the buffer with encoded R-APDU. |
[in] | len | Size of of the buffer with encoded R-APDU. |
- Return values
-
NRF_SUCCESS | If R-APDU was encoded successfully. |
NRF_ERROR_INVALID_LENGTH | If the buffer is too small to hold a valid R-APDU. |
NRF_ERROR_NULL | If any passed argument is NULL. |
Function for printing a R-APDU descriptor.
This function prints a R-APDU descriptor.
- Parameters
-
[in] | p_resp_apdu | Pointer to the R-APDU descriptor. |