NXP Reader Library  v17.1.0.2535

Implementation of SAM commands used for MIFARE Common communication in S-Mode. More...

Collaboration diagram for S_Mode:

Modules

 Defines
 Definitions for SAM commands used for MIFARE Common communication in S-Mode.
 

Functions

phStatus_t phhalHw_Sam_Cmd_SAM_CommitReaderID_Part1 (phhalHw_Sam_DataParams_t *pDataParams, uint8_t bState, uint16_t wBlockNr, uint8_t **ppResponse, uint16_t *pRespLen)
 Performs CommitReaderID command execution part 1 in S mode. More...
 
phStatus_t phhalHw_Sam_Cmd_SAM_CommitReaderID_Part2 (phhalHw_Sam_DataParams_t *pDataParams, uint8_t bPiccErrCode, uint8_t *pData, uint8_t bDataLen, uint8_t *pPiccReturnCode)
 Performs CommitReaderID command execution part 2 in S mode. More...
 

Detailed Description

Implementation of SAM commands used for MIFARE Common communication in S-Mode.

Function Documentation

◆ phhalHw_Sam_Cmd_SAM_CommitReaderID_Part1()

phStatus_t phhalHw_Sam_Cmd_SAM_CommitReaderID_Part1 ( phhalHw_Sam_DataParams_t pDataParams,
uint8_t  bState,
uint16_t  wBlockNr,
uint8_t **  ppResponse,
uint16_t pRespLen 
)

Performs CommitReaderID command execution part 1 in S mode.

The first part includes the header, block number if its MifarePlus state or only header if its DESFire state.

Note
Return values
PH_ERR_SUCCESS_CHAININGOperation successful.
PH_ERR_INVALID_DATA_PARAMSpDataParams is NULL.
PH_ERR_INVALID_PARAMETERpRespLen is NULL.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bState[In] Options for framing the command. Below options should be used.
[in]wBlockNr[In] Number of the Transaction MAC Configuration Block. Will be used if bState is MIFARE Plus.
[out]ppResponse[Out] Transaction MAC Reader ID and MAC to be sent to MIFARE Plus or MIFARE DESFire PICC.
  • TMRI: Transaction MAC Reader ID (16 byte)
    • UID: SAM UID (7 byte)
    • Padding: 0x80 || zero padding
  • MAC: 4 or 8 bytes MAC according to active Secure Messaging
[out]pRespLen[Out] Length of bytes available in ppResponse buffer.

◆ phhalHw_Sam_Cmd_SAM_CommitReaderID_Part2()

phStatus_t phhalHw_Sam_Cmd_SAM_CommitReaderID_Part2 ( phhalHw_Sam_DataParams_t pDataParams,
uint8_t  bPiccErrCode,
uint8_t pData,
uint8_t  bDataLen,
uint8_t pPiccReturnCode 
)

Performs CommitReaderID command execution part 2 in S mode.

The last part includes the header and the response received from Mfifare Plus or DESFire PICC.

Note
This interface should be called only if SAM_CommitReaderID Part1 returns Chaining Status.
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSpDataParams is NULL.
PH_ERR_INVALID_PARAMETERpData and pPiccReturnCode are NULL.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bPiccErrCode[In] Error Code sent by MIFARE Plus PICC. For success it should will
  • 0x90: MIFARE Plus
  • 0x00: MIFARE DESFire
[in]pData[In] The complete data (EncTMRI and MAC) received from MIFARE Plus or MIFARE DESFire PICC.
  • EncTMRI (16 bytes): Encrypted Transaction MAC ReaderID of the latest successful transaction retuned by the PICC. Present if bPiccErrCode = 0x00 or 0x90
  • MAC (8byte): Response MAC protection. Present if bPiccErrCode = 0x00 or 0x90 and not applying D40 Secure Messaging
  • Null otherwise
[in]bDataLen[In] Length of bytes available in pData buffer.
[out]pPiccReturnCode[Out] Error code returned by MIFARE PICC. This will of 1 byte in length.