SAM commands used for MIFARE Plus PICC communication in X-Mode. More...

Modules | |
| Defines | |
| Definitions for SAM commands used for MIFARE Plus communication in X-Mode. | |
Functions | |
| phStatus_t | phhalHw_Sam_Cmd_MFP_Authenticate (phhalHw_Sam_DataParams_t *pDataParams, uint8_t bOption, uint8_t bKeyNo, uint8_t bKeyVer, uint16_t wBlockNo, uint8_t *pPcdCapsIn, uint8_t bPcdCapsInLen, uint8_t *pDivInput, uint8_t bDivInputLen, uint8_t *pPcdCapsOut, uint8_t *pPdCaps, uint8_t *pPiccReturnCode) |
| The MFP_Authenticate supports the PICC authentication in X-mode. More... | |
| phStatus_t | phhalHw_Sam_Cmd_MFP_AuthSectorSwitch (phhalHw_Sam_DataParams_t *pDataParams, uint16_t wOption, uint16_t wSSKeyBNr, uint8_t bSSKeyNo, uint8_t bSSKeyVer, uint8_t bMSKeyNo, uint8_t bMSKeyVer, uint8_t bSectorCount, uint8_t *pKeyBlocks, uint8_t bKeyBlocksLen, uint8_t *pDivInput, uint8_t bDivInputLen, uint8_t *pPiccReturnCode) |
| The MFP_AuthSectorSwitch supports the X-mode procedure to switch the security level of MIFARE Plus sectors on the PICC. More... | |
| phStatus_t | phhalHw_Sam_Cmd_PDC_Authenticate (phhalHw_Sam_DataParams_t *pDataParams, uint8_t bOption, uint8_t bKeyNo, uint8_t bKeyVer, uint16_t wUpgradeKey, uint8_t *pUpgradeInfo, uint8_t bLen, uint8_t *pDivInput, uint8_t bDivInputLen, uint8_t *pPiccReturnCode) |
| The PDC_Authenticate supports the X-mode procedure to perform the Post-Delivery configuration on the PICC. More... | |
| phStatus_t | phhalHw_Sam_Cmd_MFP_CombinedRead (phhalHw_Sam_DataParams_t *pDataParams, uint16_t wOption, uint8_t *pReadCmd, uint8_t bReadCmdLen, uint8_t **ppData, uint16_t *pDataLen, uint8_t *pPiccReturnCode) |
| Perform a MIFARE Plus Combined Read command in X mode. More... | |
| phStatus_t | phhalHw_Sam_Cmd_MFP_CombinedWrite (phhalHw_Sam_DataParams_t *pDataParams, uint16_t wOption, uint8_t *pData, uint8_t bDataLen, uint8_t *pTMC, uint8_t *pTMV, uint8_t *pPiccReturnCode) |
| Perform a MIFARE Plus Combined Write command in X mode. More... | |
| phStatus_t | phhalHw_Sam_Cmd_MFP_ChangeKey (phhalHw_Sam_DataParams_t *pDataParams, uint8_t bOption, uint8_t bCmdCode, uint16_t wBlockNo, uint8_t bKeyNo, uint8_t bKeyVer, uint8_t *pDivInput, uint8_t bDivInputLen, uint8_t *pPiccReturnCode) |
| Perform a MIFARE Plus Change Key command in X mode. More... | |
| phStatus_t | phhalHw_Sam_Cmd_MFP_WritePerso (phhalHw_Sam_DataParams_t *pDataParams, uint16_t wOption, uint8_t *pBlocks, uint8_t bBlocksLen, uint8_t *pPiccReturnCode) |
| MFP_WritePerso is a multi-block write command. More... | |
SAM commands used for MIFARE Plus PICC communication in X-Mode.
| phStatus_t phhalHw_Sam_Cmd_MFP_Authenticate | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint8_t | bOption, | ||
| uint8_t | bKeyNo, | ||
| uint8_t | bKeyVer, | ||
| uint16_t | wBlockNo, | ||
| uint8_t * | pPcdCapsIn, | ||
| uint8_t | bPcdCapsInLen, | ||
| uint8_t * | pDivInput, | ||
| uint8_t | bDivInputLen, | ||
| uint8_t * | pPcdCapsOut, | ||
| uint8_t * | pPdCaps, | ||
| uint8_t * | pPiccReturnCode | ||
| ) |
The MFP_Authenticate supports the PICC authentication in X-mode.
It performs an authentication with the PICC and upon success generates the session keys.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pPcdCapsIn, pDivInput, pPcdCapsOut, pPdCaps and pPiccReturnCode are NULL. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bOption | [In] Key diversification & authentication mode selection. Option to update the P1 information. The options can be combined by bitwise oring.
|
| [in] | bKeyNo | [In] Key number to be used from SAM. One of the following,
|
| [in] | bKeyVer | [In] Key version to be used from SAM. |
| [in] | wBlockNo | [In] MIFARE Plus block number of key to be used for authentication. |
| [in] | pPcdCapsIn | [In] Buffer containing the Input PCD capabilites. |
| [in] | bPcdCapsInLen | [In] Input PCD capabilites Length to be exchanged. One of the following,
|
| [in] | pDivInput | [In] Diversification Input used to diversify the key.
|
| [in] | bDivInputLen | [In] Length of bytes available in pDivInput buffer. |
| [out] | pPcdCapsOut | [Out] Buffer containing the Output PCD capabilities. This will be of 6 bytes. |
| [out] | pPdCaps | [Out] Buffer containing the Output PD capabilities. This will be of 6 bytes. |
| [out] | pPiccReturnCode | [Out] Error code returned by MIFARE Plus PICC. This will of 1 byte in length. |
| phStatus_t phhalHw_Sam_Cmd_MFP_AuthSectorSwitch | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| uint16_t | wSSKeyBNr, | ||
| uint8_t | bSSKeyNo, | ||
| uint8_t | bSSKeyVer, | ||
| uint8_t | bMSKeyNo, | ||
| uint8_t | bMSKeyVer, | ||
| uint8_t | bSectorCount, | ||
| uint8_t * | pKeyBlocks, | ||
| uint8_t | bKeyBlocksLen, | ||
| uint8_t * | pDivInput, | ||
| uint8_t | bDivInputLen, | ||
| uint8_t * | pPiccReturnCode | ||
| ) |
The MFP_AuthSectorSwitch supports the X-mode procedure to switch the security level of MIFARE Plus sectors on the PICC.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pKeyBlocks, pDivInput and pPiccReturnCode are NULL. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Buffering options and Key diversification selection, for exchanging information to SAM. The options can be combined by bitwise oring.
|
| [in] | wSSKeyBNr | [In] PICC Sector Switch key block number to be used for authentication. |
| [in] | bSSKeyNo | [In] Sector Switch Key number to be used from SAM (that is: Kss selection). One of the following,
|
| [in] | bSSKeyVer | [In] Sector Switch Key version to be used from SAM (that is: Kss selection) |
| [in] | bMSKeyNo | [In] Master Key number to be used from SAM One of the following,
|
| [in] | bMSKeyVer | [In] Master Key version to be used from SAM. |
| [in] | bSectorCount | [In] Number of sectors to be switched inside the PICC.
|
| [in] | pKeyBlocks | [In] Buffer containing the PICC KeyB block number and reference key number and version to be used form SAM. Should contain the following,
|
| [in] | bKeyBlocksLen | [In] Length of bytes available in pKeyBlocks buffer. It should be equal to (KeyBxBNr + [KeyNo] + [KeyVer]) * bSectorCount |
| [in] | pDivInput | [In] Buffer containing the diversification inputs to be used for diversifying the key.
|
| [in] | bDivInputLen | [In] Length of bytes available in pDivInput buffer. |
| [out] | pPiccReturnCode | [Out] Error code returned by MIFARE Plus PICC. This will of 1 byte in length. |
| phStatus_t phhalHw_Sam_Cmd_PDC_Authenticate | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint8_t | bOption, | ||
| uint8_t | bKeyNo, | ||
| uint8_t | bKeyVer, | ||
| uint16_t | wUpgradeKey, | ||
| uint8_t * | pUpgradeInfo, | ||
| uint8_t | bLen, | ||
| uint8_t * | pDivInput, | ||
| uint8_t | bDivInputLen, | ||
| uint8_t * | pPiccReturnCode | ||
| ) |
The PDC_Authenticate supports the X-mode procedure to perform the Post-Delivery configuration on the PICC.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pUpgradeInfo, pDivInput and pPiccReturnCode are NULL. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bOption | [In] Key diversification selection. Option to set the P1 information byte.
|
| [in] | bKeyNo | [In] Key number to be used from SAM. One of the following,
|
| [in] | bKeyVer | [In] Key version to be used from SAM. |
| [in] | wUpgradeKey | [In] PICC UpgradeKey to be used for authentication. |
| [in] | pUpgradeInfo | [In] Upgrade information of the target product state. |
| [in] | bLen | [In] Length of bytes available in pUpgradeInfo buffer.
|
| [in] | pDivInput | [In] Diversification input for generating KeyID.ICUpgrade Key , ie.: VCUID. |
| [in] | bDivInputLen | [In] Length of bytes available in pDivInput buffer. |
| [out] | pPiccReturnCode | [Out] Error code returned by MIFARE Plus PICC. This will of 1 byte in length. |
| phStatus_t phhalHw_Sam_Cmd_MFP_CombinedRead | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| uint8_t * | pReadCmd, | ||
| uint8_t | bReadCmdLen, | ||
| uint8_t ** | ppData, | ||
| uint16_t * | pDataLen, | ||
| uint8_t * | pPiccReturnCode | ||
| ) |
Perform a MIFARE Plus Combined Read command in X mode.
This command is used to perform GetVersion, ReadSignature and all Read related operations.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_SUCCESS_CHAINING | Successfull Chaining operation. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pReadCmd, pDataLen and pPiccReturnCode are NULL. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Option for receiving the next data chunk if previous status from SAM was chaining.
|
| [in] | pReadCmd | [In] The different types of command to be sent to MIFARE Plus PICC and received the response.
|
| [in] | bReadCmdLen | [In] Length of bytes available in pReadCmd buffer. |
| [out] | ppData | [Out] The information returned by SAM for the mentioned command in pReadCmd buffer. |
| [out] | pDataLen | [Out] Length of bytes available in ppData buffer. |
| [out] | pPiccReturnCode | [Out] Error code returned by MIFARE Plus PICC. This will of 1 byte in length. |
| phStatus_t phhalHw_Sam_Cmd_MFP_CombinedWrite | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| uint8_t * | pData, | ||
| uint8_t | bDataLen, | ||
| uint8_t * | pTMC, | ||
| uint8_t * | pTMV, | ||
| uint8_t * | pPiccReturnCode | ||
| ) |
Perform a MIFARE Plus Combined Write command in X mode.
This command performs Write, Increment, Decrement, Transfer, Restore, IncrementTransfer and DecrementTransfer commands of the PICC.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pReadCmd, pDataLen and pPiccReturnCode are NULL. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Option flag to buffer the payload information.
|
| [in] | pData | [In] The different types of command to be sent to MIFARE Plus PICC and received the response,
|
| [in] | bDataLen | [In] Length of bytes available in pData buffer. |
| [out] | pTMC | [Out] Only available is the block is a TMProtected block. The buffer will have 4 bytes of Transaction MAC counter information. |
| [out] | pTMV | [Out] Only available is the block is a TMProtected block. The buffer will have 8 bytes of Transaction MAC value. |
| [out] | pPiccReturnCode | [Out] Error code returned by MIFARE Plus PICC. This will of 1 byte in length. |
| phStatus_t phhalHw_Sam_Cmd_MFP_ChangeKey | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint8_t | bOption, | ||
| uint8_t | bCmdCode, | ||
| uint16_t | wBlockNo, | ||
| uint8_t | bKeyNo, | ||
| uint8_t | bKeyVer, | ||
| uint8_t * | pDivInput, | ||
| uint8_t | bDivInputLen, | ||
| uint8_t * | pPiccReturnCode | ||
| ) |
Perform a MIFARE Plus Change Key command in X mode.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pDivInput and pPiccReturnCode are NULL. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bOption | [In] The below flags should be for updating the P1 information byte. |
| [in] | bCmdCode | [In] The MIFARE Plus Write (Cmd.WRITEEy) command code to be used for writting the key. (0xA0 or 0xA1) |
| [in] | wBlockNo | [In] MIFARE Plus Key Block number
|
| [in] | bKeyNo | [In] Key number to be used from SAM. One of the following,
|
| [in] | bKeyVer | [In] Key version to be used from SAM. |
| [in] | pDivInput | [In] Diversification Input used to diversify the key. |
| [in] | bDivInputLen | [In] Length of bytes available in pDivInput buffer. |
| [out] | pPiccReturnCode | [Out] Error code returned by MIFARE Plus PICC. This will of 1 byte in length. |
| phStatus_t phhalHw_Sam_Cmd_MFP_WritePerso | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| uint8_t * | pBlocks, | ||
| uint8_t | bBlocksLen, | ||
| uint8_t * | pPiccReturnCode | ||
| ) |
MFP_WritePerso is a multi-block write command.
It efficiently performs in X-mode up to 13 MIFARE Plus PICC WritePerso commands targeting one block each. If more than 13 blocks are to be updated, several MFP_WritePerso are to be issued. The blocks are transmitted to the SAM in one MFP_WritePerso , then the SAM shall execute the many required PICC WritePerso commands.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pBlocks and pPiccReturnCode are NULL. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Option flag to buffer the payload information.
|
| [in] | pBlocks | [In] Buffer containing the Block and Data pair to be written to MIFAER Plus PICC by SAM. Should be holding an array of block number and data like,
|
| [in] | bBlocksLen | [In] Length of bytes available in pBlocks buffer. |
| [out] | pPiccReturnCode | [Out] Error code returned by MIFARE Plus PICC. This will of 1 byte in length. |