These Functions implement the MIFARE DESFire(R) EV1 commands.
More...
|
phStatus_t | phalMfdf_IsoSelectFile (void *pDataParams, uint8_t bOption, uint8_t bSelector, uint8_t *pFid, uint8_t *pDFname, uint8_t bDFnameLen, uint8_t **ppFCI, uint16_t *pwFCILen) |
| ISO Select. More...
|
|
phStatus_t | phalMfdf_IsoReadBinary (void *pDataParams, uint16_t wOption, uint8_t bOffset, uint8_t bSfid, uint8_t bBytesToRead, uint8_t **ppRxBuffer, uint16_t *pBytesRead) |
| ISO Read Binary wOption can be one of:
. More...
|
|
phStatus_t | phalMfdf_IsoUpdateBinary (void *pDataParams, uint8_t bOffset, uint8_t bSfid, uint8_t *pData, uint8_t bDataLen) |
| Iso Update Binary. More...
|
|
These Functions implement the MIFARE DESFire(R) EV1 commands.
§ PHAL_MFDF_NOT_AUTHENTICATED
#define PHAL_MFDF_NOT_AUTHENTICATED 0xFFU |
§ PHAL_MFDF_COMMUNICATION_PLAIN
#define PHAL_MFDF_COMMUNICATION_PLAIN 0x00U |
Plain mode of communication.
§ PHAL_MFDF_COMMUNICATION_MACD
#define PHAL_MFDF_COMMUNICATION_MACD 0x10U |
MAC mode of communication.
§ PHAL_MFDF_COMMUNICATION_ENC
#define PHAL_MFDF_COMMUNICATION_ENC 0x30U |
Enciphered mode of communication.
§ PHAL_MFDF_ADDITIONAL_INFO
#define PHAL_MFDF_ADDITIONAL_INFO 0x00A1 |
Option for getconfig to get additional info of a generic error.
§ PHAL_MFDF_NO_CHANGES
MF DF Response - No changes done to backup files.
§ PHAL_MFDF_ERR_OUT_OF_EEPROM_ERROR
MF DF Response - Insufficient NV-Memory.
§ PHAL_MFDF_ERR_NO_SUCH_KEY
MF DF Invalid key number specified.
§ PHAL_MFDF_ERR_PERMISSION_DENIED
MF DF Current configuration/status does not allow the requested command.
§ PHAL_MFDF_ERR_APPLICATION_NOT_FOUND
MF DF Requested AID not found on PICC.
§ PHAL_MFDF_ERR_BOUNDARY_ERROR
MF DF Attempt to read/write data from/to beyond the files/record's limits.
§ PHAL_MFDF_ERR_COMMAND_ABORTED
MF DF Previous cmd not fully completed.
Not all frames were requested or provided by the PCD.
§ PHAL_MFDF_ERR_COUNT
MF DF Num.
of applns limited to 28. No additional applications possible.
§ PHAL_MFDF_ERR_DUPLICATE
MF DF File/Application with same number already exists.
§ PHAL_MFDF_ERR_FILE_NOT_FOUND
MF DF Specified file number does not exist.
§ PHAL_MFDF_ERR_PICC_CRYPTO
MF DF Crypto error returned by PICC.
§ PHAL_MFDF_ERR_PARAMETER_ERROR
MF DF Parameter value error returned by PICC.
§ PHAL_MFDF_ERR_DF_GEN_ERROR
MF DF DesFire Generic error.
Check additional Info.
§ PHAL_MFDF_ERR_DF_7816_GEN_ERROR
MF DF ISO 7816 Generic error.
Check Additional Info.
§ phalMfdf_CreateApplication()
Creates new applications on the PICC.
bOption value can be
- 01 meaning wISOFileId is supplied
- 02 meaning pISODFName is present
- 03 meaning both wISOFileId and pISODFName are present
- 00 meaning both not present
- Returns
- Status code
- Return values
-
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlying component. |
- Parameters
-
[in] | pDataParams | Pointer to this layers param structure |
[in] | bOption | Option parameter. |
[in] | pAid | array of 3 bytes. |
[in] | bKeySettings1 | 1 byte. |
[in] | bKeySettings2 | 1 byte. |
[in] | pISOFileId | 2 btyes ISO File ID. |
[in] | pISODFName | 1 to 16 Bytes. Can also be NULL. |
[in] | bISODFNameLen | Size of pISODFName if that is present. |
§ phalMfdf_SelectApplication()
phStatus_t phalMfdf_SelectApplication |
( |
void * |
pDataParams, |
|
|
uint8_t * |
pAid |
|
) |
| |
Selects one particular application on the PICC for further access.
- Returns
- Status code
- Return values
-
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlying component. |
- Parameters
-
[in] | pDataParams | Pointer to this layers param structure. |
[in] | pAid | 3 byte AID. LSB First. |
§ phalMfdf_GetVersion()
phStatus_t phalMfdf_GetVersion |
( |
void * |
pDataParams, |
|
|
uint8_t * |
pVerInfo |
|
) |
| |
Returns manufacturing related data of the PICC.
- Returns
- Status code
- Return values
-
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlying component. |
- Parameters
-
[in] | pDataParams | Pointer to this layers param structure. |
[out] | pVerInfo | 28bytes of version info. User has to parse this. |
§ phalMfdf_CreateStdDataFile()
Creates files for storage of plain unformatted user data within an existing application on the PICC.
- Returns
- Status code
- Return values
-
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlying component. |
- Parameters
-
[in] | pDataParams | Pointer to this layers param structure. |
[in] | bOption | option parameter. 0x00 means wISOFileId is not provided. 0x01 means wISOFileId is provided and is valid |
[in] | bFileNo | file number. |
[in] | pISOFileId | ISO File ID. |
[in] | bCommSett | communication settings. |
[in] | pAccessRights | 2 byte access rights. Sent LSB first to PICC. |
[in] | pFileSize | 3bytes. Sent LSB first to PICC. |
§ phalMfdf_WriteData()
- Parameters
-
[in] | pDataParams | Pointer to this layers param structure. |
[in] | bCommOption | Communication Mode. Plain, Mac'd or encrypted. |
[in] | bFileNo | 1 byte file number. |
[in] | pOffset | 3 bytes offset. LSB First. |
[in] | pTxData | Data to be written. |
[in] | pTxDataLen | 3 bytes. length of data to be written. |
§ phalMfdf_IsoSelectFile()
ISO Select.
- Returns
- Status code
- Return values
-
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlying component. |
- Parameters
-
[in] | pDataParams | Pointer to this layers param structure. |
[in] | bOption | If bOption == 00 FCI is returned. If 0x0C no FCI returned. |
[in] | bSelector | bSelector equals either 0x00 or 0x02 or 0x04. |
[in] | pFid | two byte file id. Send LSB first. |
[in] | pDFname | DFName upto 16 bytes. valid only when bOption = 0x04. |
[in] | bDFnameLen | Length of DFName string provided by the user. |
[out] | ppFCI | File control information. |
[out] | pwFCILen | Length of FCI returned. |
§ phalMfdf_IsoReadBinary()
ISO Read Binary wOption
can be one of:
.
If status of PH_ERR_SUCCESS_CHAINING is returned Recall this function with wOption PH_EXCHANGE_RXCHAINING to get remaining data.
- Returns
- Status code
- Return values
-
- Parameters
-
[in] | pDataParams | Pointer to this layers param structure. |
[in] | wOption | PH_EXCHANGE_DEFAULT or PH_EXCHANGE_RXCHAINING. |
[in] | bOffset | Offset from where to read. |
[in] | bSfid | Short ISO File Id. Bit 7 should be 1 to indicate Sfid is supplied. Else it is treated as MSB of 2Byte offset. |
[in] | bBytesToRead | number of bytes to read. If 0, then entire file to be read. |
[out] | ppRxBuffer | buffer where the read bytes will be stored. |
[out] | pBytesRead | number of bytes read. |
§ phalMfdf_IsoUpdateBinary()
Iso Update Binary.
- Returns
- Status code
- Return values
-
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlying component. |
- Parameters
-
[in] | pDataParams | Pointer to this layers param structure. |
[in] | bOffset | Offset from where to write. |
[in] | bSfid | Short ISO File Id. Bit 7 should be 1 to indicate Sfid is supplied Else it is treated as MSB of 2Byte offset. |
[in] | pData | data to be written. |
[in] | bDataLen | number of bytes to write. |
§ phalMfdf_GetConfig()
phStatus_t phalMfdf_GetConfig |
( |
void * |
pDataParams, |
|
|
uint16_t |
wConfig, |
|
|
uint16_t * |
pValue |
|
) |
| |
Perform a GetConfig command.
wConfig
can be one of:
- Returns
- Status code
- Return values
-
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlaying component. |
- Parameters
-
[in] | pDataParams | Pointer to this layers parameter structure. |
[in] | wConfig | Item to read. |
[out] | pValue | Read value. |
§ phalMfdf_SetConfig()
phStatus_t phalMfdf_SetConfig |
( |
void * |
pDataParams, |
|
|
uint16_t |
wConfig, |
|
|
uint16_t |
wValue |
|
) |
| |
Perform a SetConfig command.
wConfig
can:
- Returns
- Status code
- Return values
-
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlaying component. |
- Parameters
-
[in] | pDataParams | Pointer to this layers parameter structure. |
[in] | wConfig | Item to set. |
[in] | wValue | Value to set. |