NXP Reader Library  v17.1.0.2535

These Components implement the MIFARE(R) Classic, MIFARE(R) Ultralight, MIFARE(R) DESFire and MIFARE(R) Plus products. More...

Collaboration diagram for MIFARE(R):

Modules

 Component : Stub
 Component without functionality to ease implementation of additional busses.
 
 Component : Software
 
 Component : Rd710
 Component without functionality to ease implementation of additional busses.
 
 Component : PCSC
 Component without functionality to ease implementation of additional busses.
 
 Component : SamAV2_X
 
 Component : SamAV3_X
 

Functions

phStatus_t phpalMifare_ExchangeL3 (void *pDataParams, uint16_t wOption, uint8_t *pTxBuffer, uint16_t wTxLength, uint8_t **ppRxBuffer, uint16_t *pRxLength)
 Perform ISO14443-3 Data Exchange with MIFARE Picc. More...
 
phStatus_t phpalMifare_ExchangeL4 (void *pDataParams, uint16_t wOption, uint8_t *pTxBuffer, uint16_t wTxLength, uint8_t **ppRxBuffer, uint16_t *pRxLength)
 Perform ISO14443-4 Data Exchange with MIFARE Picc. More...
 
phStatus_t phpalMifare_ExchangePc (void *pDataParams, uint16_t wOption, uint8_t *pTxBuffer, uint16_t wTxLength, uint8_t **ppRxBuffer, uint16_t *pRxLength)
 Perform Proximity-Check Data Exchange with MIFARE Picc. More...
 
phStatus_t phpalMifare_ExchangeRaw (void *pDataParams, uint16_t wOption, uint8_t *pTxBuffer, uint16_t wTxLength, uint8_t bTxLastBits, uint8_t **ppRxBuffer, uint16_t *pRxLength, uint8_t *pRxLastBits)
 Perform Raw (No CRC, No Parity) Data Exchange with MIFARE Picc. More...
 
phStatus_t phpalMifare_MfcAuthenticateKeyNo (void *pDataParams, uint8_t bBlockNo, uint8_t bKeyType, uint16_t wKeyNo, uint16_t wKeyVersion, uint8_t *pUid)
 Perform MIFARE(R) Authenticate command with Picc using a key number. More...
 
phStatus_t phpalMifare_MfcAuthenticate (void *pDataParams, uint8_t bBlockNo, uint8_t bKeyType, uint8_t *pKey, uint8_t *pUid)
 Perform MIFARE(R) Authenticate command with Picc using a key. More...
 
phStatus_t phpalMifare_SetMinFdtPc (void *pDataParams, uint16_t wValue)
 Perform Setting min FDT for Proximity check. More...
 
phStatus_t phpalMifare_GetConfig (void *pDataParams, uint16_t wConfig, uint16_t *pValue)
 Get configuration parameter. More...
 
phStatus_t phpalMifare_SetConfig (void *pDataParams, uint16_t wConfig, uint16_t wValue)
 Set configuration parameter. More...
 

Authenticate Options

#define PHPAL_MIFARE_KEYA   0x0AU
 MIFARE Classic Key Type A.
 
#define PHPAL_MIFARE_KEYB   0x0BU
 MIFARE Classic Key Type B.
 
#define PHPAL_MIFARE_KEY_LENGTH   0x06U
 Length of a MIFARE Classic key (for completeness).
 

Detailed Description

These Components implement the MIFARE(R) Classic, MIFARE(R) Ultralight, MIFARE(R) DESFire and MIFARE(R) Plus products.

Function Documentation

◆ phpalMifare_ExchangeL3()

phStatus_t phpalMifare_ExchangeL3 ( void *  pDataParams,
uint16_t  wOption,
uint8_t pTxBuffer,
uint16_t  wTxLength,
uint8_t **  ppRxBuffer,
uint16_t pRxLength 
)

Perform ISO14443-3 Data Exchange with MIFARE Picc.

wOption can be one of:

Alternatively, the following bits can be combined:

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wOption[In] Option parameter.
[in]pTxBuffer[In] Data to transmit.
[in]wTxLength[In] Length of data to transmit.
[out]ppRxBuffer[Out] Pointer to received data.
[out]pRxLength[Out] number of received data bytes.

◆ phpalMifare_ExchangeL4()

phStatus_t phpalMifare_ExchangeL4 ( void *  pDataParams,
uint16_t  wOption,
uint8_t pTxBuffer,
uint16_t  wTxLength,
uint8_t **  ppRxBuffer,
uint16_t pRxLength 
)

Perform ISO14443-4 Data Exchange with MIFARE Picc.

wOption can be one of:

Additionally, the following options are also available:

Alternatively to the FIRST/CONT/LAST options, the following bits can be combined:

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wOption[In] Option parameter.
[in]pTxBuffer[In] Data to transmit.
[in]wTxLength[In] Length of data to transmit.
[out]ppRxBuffer[Out] Pointer to received data.
[out]pRxLength[Out] number of received data bytes.

◆ phpalMifare_ExchangePc()

phStatus_t phpalMifare_ExchangePc ( void *  pDataParams,
uint16_t  wOption,
uint8_t pTxBuffer,
uint16_t  wTxLength,
uint8_t **  ppRxBuffer,
uint16_t pRxLength 
)

Perform Proximity-Check Data Exchange with MIFARE Picc.

Note: The wOption parameter is currently RFU.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wOption[In] Option parameter.
[in]pTxBuffer[In] Data to transmit.
[in]wTxLength[In] Length of data to transmit.
[out]ppRxBuffer[Out] Pointer to received data.
[out]pRxLength[Out] number of received data bytes.

◆ phpalMifare_ExchangeRaw()

phStatus_t phpalMifare_ExchangeRaw ( void *  pDataParams,
uint16_t  wOption,
uint8_t pTxBuffer,
uint16_t  wTxLength,
uint8_t  bTxLastBits,
uint8_t **  ppRxBuffer,
uint16_t pRxLength,
uint8_t pRxLastBits 
)

Perform Raw (No CRC, No Parity) Data Exchange with MIFARE Picc.

wOption can be one of:

Alternatively, the following bits can be combined:

In Sam non X configuration, wOption can be combined with the following options to instruct Sam to not do enciphering and/or deciphering.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wOption[In] Option parameter.
[in]pTxBuffer[In] Data to transmit.
[in]wTxLength[In] Length of input data.
[in]bTxLastBits[In] Number of valid bits of last byte (Tx).
[out]ppRxBuffer[Out] Pointer to received data.
[out]pRxLength[Out] Number of received data bytes including incomplete byte.
[out]pRxLastBits[Out] Number of valid bits of last byte (Rx).

◆ phpalMifare_MfcAuthenticateKeyNo()

phStatus_t phpalMifare_MfcAuthenticateKeyNo ( void *  pDataParams,
uint8_t  bBlockNo,
uint8_t  bKeyType,
uint16_t  wKeyNo,
uint16_t  wKeyVersion,
uint8_t pUid 
)

Perform MIFARE(R) Authenticate command with Picc using a key number.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_IO_TIMEOUTError in authentication.
PH_ERR_AUTH_ERRORError in authentication.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bBlockNo[In] Blocknumber on card to authenticate to.
[in]bKeyType[In] Either PHPAL_MIFARE_KEYA or PHPAL_MIFARE_KEYB
[in]wKeyNo[In] Key number to be used in authentication.
[in]wKeyVersion[In] Key version to be used in authentication.
[in]pUid[In] Serial number of current cascade level; uint8_t[4].

◆ phpalMifare_MfcAuthenticate()

phStatus_t phpalMifare_MfcAuthenticate ( void *  pDataParams,
uint8_t  bBlockNo,
uint8_t  bKeyType,
uint8_t pKey,
uint8_t pUid 
)

Perform MIFARE(R) Authenticate command with Picc using a key.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_IO_TIMEOUTError in authentication.
PH_ERR_AUTH_ERRORError in authentication.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bBlockNo[In] Blocknumber on card to authenticate to.
[in]bKeyType[In] Either PHPAL_MIFARE_KEYA or PHPAL_MIFARE_KEYB
[in]pKey[In] Key to be used in authentication.
[in]pUid[In] Serial number of current cascade level; uint8_t[4].

◆ phpalMifare_SetMinFdtPc()

phStatus_t phpalMifare_SetMinFdtPc ( void *  pDataParams,
uint16_t  wValue 
)

Perform Setting min FDT for Proximity check.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_IO_TIMEOUTError in authentication.
PH_ERR_AUTH_ERRORError in authentication.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wValue[In] Option parameter. '1' for setting '0' for resetting

◆ phpalMifare_GetConfig()

phStatus_t phpalMifare_GetConfig ( void *  pDataParams,
uint16_t  wConfig,
uint16_t pValue 
)

Get configuration parameter.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wConfig[In] Configuration Identifier
[out]pValue[Out] Configuration Value

◆ phpalMifare_SetConfig()

phStatus_t phpalMifare_SetConfig ( void *  pDataParams,
uint16_t  wConfig,
uint16_t  wValue 
)

Set configuration parameter.

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]wConfig[In] Configuration Identifier
[in]wValue[In] Configuration Value