NXP Reader Library  v17.1.0.2535
Commands_FileManagement

These Components implement the MIFARE DESFire Light File Management related commands. More...

Collaboration diagram for Commands_FileManagement:

Functions

phStatus_t phalMfdfLight_CreateTransactionMacFile (void *pDataParams, uint8_t bFileNo, uint8_t bCommMode, uint8_t *pAccessRights, uint8_t bKeyType, uint8_t *bTMKey, uint16_t wKeyNo, uint8_t bTMKeyVer, uint8_t *pDivInput, uint8_t bDivInputLen)
 Creates a Transaction MAC file. More...
 
phStatus_t phalMfdfLight_DeleteFile (void *pDataParams, uint8_t bFileNo)
 Permanently deactivates a file within the file directory of the currently selected application. More...
 
phStatus_t phalMfdfLight_GetFileIDs (void *pDataParams, uint8_t *pFid, uint8_t *bNumFid)
 Returns the file IDs of all active files within the currently selected application. More...
 
phStatus_t phalMfdfLight_GetISOFileIDs (void *pDataParams, uint8_t *pFidBuffer, uint8_t *bNumFid)
 Get the ISO File IDs. More...
 
phStatus_t phalMfdfLight_GetFileSettings (void *pDataParams, uint8_t bFileNo, uint8_t *pFSBuffer, uint8_t *bBufferLen)
 Get informtion on the properties of a specific file. More...
 
phStatus_t phalMfdfLight_ChangeFileSettings (void *pDataParams, uint8_t bOption, uint8_t bFileNo, uint8_t bFileOption, uint8_t *pAccessRights, uint8_t bAdditionalInfoLen, uint8_t *bAdditionalInfo)
 Changes the access parameters of an existing file. More...
 

Diversification options to be used with CreateTransactionMacFile command.

These macros are valid only if the layer is initialized for SAM.

#define PHAL_MFDFLIGHT_CRTMACFILE_DIVERSIFICATION_OFF   0x00U
 No diversification.
 
#define PHAL_MFDFLIGHT_CRTMACFILE_DIVERSIFICATION_ON   0x01U
 Diversification is enabled.
 

The File option and other flags for ChangeFileSettings command.

#define PHAL_MFDFLIGHT_FILE_OPTION_PLAIN   0x00U
 Plain mode of communication.
 
#define PHAL_MFDFLIGHT_FILE_OPTION_PLAIN_1   0x02U
 Plain mode of communication.
 
#define PHAL_MFDFLIGHT_FILE_OPTION_MACD   0x01U
 MAC mode of communication.
 
#define PHAL_MFDFLIGHT_FILE_OPTION_ENC   0x03U
 Enciphered mode of communication.
 
#define PHAL_MFDFLIGHT_MFM_SPECIFICS_ENABLED   0x01U
 MFM Specific feature(TMC Limit) to be realized.
 
#define PHAL_MFDFLIGHT_TMCLIMITCONFIG   0x20U
 5th Bit of FileOption indicating TMC limit config.
 
#define PHAL_MFDFLIGHT_EXCLUNAUTHCONFIG   0x10U
 4th Bit of FileOption indicating Excude Unauthentication config.
 

Detailed Description

These Components implement the MIFARE DESFire Light File Management related commands.

Function Documentation

◆ phalMfdfLight_CreateTransactionMacFile()

phStatus_t phalMfdfLight_CreateTransactionMacFile ( void *  pDataParams,
uint8_t  bFileNo,
uint8_t  bCommMode,
uint8_t pAccessRights,
uint8_t  bKeyType,
uint8_t bTMKey,
uint16_t  wKeyNo,
uint8_t  bTMKeyVer,
uint8_t pDivInput,
uint8_t  bDivInputLen 
)

Creates a Transaction MAC file.

An application can have only one Transaction MAC File.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bFileNo[In] File number of the file to be created.
[in]bCommMode[In] Communication settings for the file.
[in]pAccessRights[In] The access right to be applied for the file. Should be 2 byte.
[in]bKeyType[In] Bit0-1 indicates key type and it should be always PHAL_MFDFLIGHT_KEY_TYPE_AES128
[in]bTMKey[In] The 16 byte key value to be used as TMKey.
[in]wKeyNo[In] The reference key number in SAM keystore. Only valid if initialized for SAM.
[in]bTMKeyVer[In] The version of the TMKey.
[in]pDivInput[In] Diversification input to diversify the TMKey.
[in]bDivInputLen[In] Length of bytes available in DivInput buffer.

◆ phalMfdfLight_DeleteFile()

phStatus_t phalMfdfLight_DeleteFile ( void *  pDataParams,
uint8_t  bFileNo 
)

Permanently deactivates a file within the file directory of the currently selected application.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bFileNo[In] File number of the file to be deleted.

◆ phalMfdfLight_GetFileIDs()

phStatus_t phalMfdfLight_GetFileIDs ( void *  pDataParams,
uint8_t pFid,
uint8_t bNumFid 
)

Returns the file IDs of all active files within the currently selected application.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[out]pFid[Out] The buffer containing the available file ID(s). Buffer should be 32 bytes.
[out]bNumFid[Out] The length of bytes available in Fid buffer.

◆ phalMfdfLight_GetISOFileIDs()

phStatus_t phalMfdfLight_GetISOFileIDs ( void *  pDataParams,
uint8_t pFidBuffer,
uint8_t bNumFid 
)

Get the ISO File IDs.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[out]pFidBuffer[Out] The buffer containing the available ISO file ID(s). Buffer should be 64 bytes.
[out]bNumFid[Out] The number of ISO File ID's read.

◆ phalMfdfLight_GetFileSettings()

phStatus_t phalMfdfLight_GetFileSettings ( void *  pDataParams,
uint8_t  bFileNo,
uint8_t pFSBuffer,
uint8_t bBufferLen 
)

Get informtion on the properties of a specific file.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bFileNo[In] The file number for which the setting to be retrieved.
[out]pFSBuffer[Out] The buffer containing the settings. The buffer should be 17 bytes.
[out]bBufferLen[Out] The length of bytes available in FSBuffer buffer.

◆ phalMfdfLight_ChangeFileSettings()

phStatus_t phalMfdfLight_ChangeFileSettings ( void *  pDataParams,
uint8_t  bOption,
uint8_t  bFileNo,
uint8_t  bFileOption,
uint8_t pAccessRights,
uint8_t  bAdditionalInfoLen,
uint8_t bAdditionalInfo 
)

Changes the access parameters of an existing file.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bOption[In] Indicates the mode of communication to be used while exchanging the data to PICC.
[in]bFileNo[In] File number for which the setting need to be updated.
[in]bFileOption[In] New communication settings for the file.
[in]pAccessRights[In] The new access right to be applied for the file. Should be 2 byte.
[in]bAdditionalInfoLen[In] Length of the Additional Info to be sent (2 Bytes or 4 Bytes). This is used to set TMC Limit in case of TMAC File
[in]bAdditionalInfo[In] One of the below inforamtion.
If Standard AES: 4 byte TMC Limit value.
If LRP : 2 byte TMC Limit value.