NXP Reader Library  v17.1.0.2535

HAL Operation Command of HAL DUT Command dispatcher frame. More...

Collaboration diagram for Command_HALOps:

Modules

 Command_Codes
 HAL Operation Command Codes of HAL DUT Command dispatcher frame.
 

Functions

phStatus_t phhalHw_DUT_Cmd_HAL_Exchange (phhalHw_DUT_DataParams_t *pDataParams, uint16_t wOption, uint8_t *pTxBuff, uint16_t wTxLen, uint8_t **ppRxBuff, uint16_t *pRxLen)
 Perform Data Exchange with a PICC. More...
 
phStatus_t phhalHw_DUT_Cmd_HAL_SetConfig (phhalHw_DUT_DataParams_t *pDataParams, uint16_t wConfig, uint16_t wValue)
 Set configuration parameter. More...
 
phStatus_t phhalHw_DUT_Cmd_HAL_GetConfig (phhalHw_DUT_DataParams_t *pDataParams, uint16_t wConfig, uint16_t *pValue)
 Get configuration parameter. More...
 
phStatus_t phhalHw_DUT_Cmd_HAL_ApplyProtocolSettings (phhalHw_DUT_DataParams_t *pDataParams, uint8_t bCardType)
 Apply protocol settings. More...
 
phStatus_t phhalHw_DUT_Cmd_HAL_Wait (phhalHw_DUT_DataParams_t *pDataParams, uint8_t bUnit, uint16_t wTimeout)
 Blocks until the time given by wTimeout elapsed. More...
 
phStatus_t phhalHw_DUT_Cmd_HAL_MfcAuthenticate (phhalHw_DUT_DataParams_t *pDataParams, uint8_t bBlockNo, uint8_t bKeyType, uint8_t *pKey, uint8_t *pUid)
 Perform MIFARE(R) Classic Authentication using a key. More...
 
phStatus_t phhalHw_DUT_Cmd_HAL_Execute (phhalHw_DUT_DataParams_t *pDataParams, uint8_t bCmd, uint16_t wOption, uint8_t *pTxBuff, uint16_t wTxLen, uint8_t **ppRxBuff, uint16_t *pRxLen)
 Perform Command Execution with a PICC. More...
 
phStatus_t phhalHw_DUT_Cmd_HAL_MfcAuthenticateKeyNo (phhalHw_DUT_DataParams_t *pDataParams, uint8_t bBlockNo, uint8_t bKeyType, uint16_t wKeyNo, uint16_t wKeyVer, uint8_t *pUid)
 Perform MIFARE(R) Classic Authentication using a key number. More...
 
phStatus_t phhalHw_DUT_Cmd_HAL_Transmit (phhalHw_DUT_DataParams_t *pDataParams, uint16_t wOption, uint8_t *pTxBuff, uint16_t wTxLen)
 Perform Transmission of data with a PICC. More...
 
phStatus_t phhalHw_DUT_Cmd_HAL_Receive (phhalHw_DUT_DataParams_t *pDataParams, uint16_t wOption, uint8_t **ppRxBuff, uint16_t *pRxLen)
 Perform Reception of Data from a PICC. More...
 
phStatus_t phhalHw_DUT_Cmd_HAL_I18000p3m3Inventory (phhalHw_DUT_DataParams_t *pDataParams, uint8_t *pSelCmd, uint8_t bSelCmdLen, uint8_t bNumValidBitsinLastByte, uint8_t *pBeginRndCmd, uint8_t bTSprocessing, uint8_t **ppRxBuff, uint16_t *pRxLen)
 ISO 18000p3m3 Inventory command. More...
 
phStatus_t phhalHw_DUT_Cmd_HAL_I18000p3m3ResumeInventory (phhalHw_DUT_DataParams_t *pDataParams, uint8_t **ppRxBuff, uint16_t *pRxLen)
 ISO 18000p3m3 resume inventory command. More...
 

Detailed Description

HAL Operation Command of HAL DUT Command dispatcher frame.

Note
  • These command codes will be used to communicate to a contactless device connected via RF only.
  • To perfom PICC / Tag exchanges via I2C use I2C sepcific commands.

Function Documentation

◆ phhalHw_DUT_Cmd_HAL_Exchange()

phStatus_t phhalHw_DUT_Cmd_HAL_Exchange ( phhalHw_DUT_DataParams_t pDataParams,
uint16_t  wOption,
uint8_t pTxBuff,
uint16_t  wTxLen,
uint8_t **  ppRxBuff,
uint16_t pRxLen 
)

Perform Data Exchange with a PICC.

This command is used to exchange information to PICC and at the same time receives the payload from PICC if available including the Status.

wOption can be one of:

  • Normal Exchange
    • Default To frame and exchange the complete payload information to PICC and also receives the payload from PICC if available.
    • Buffer Initial Payload To buffer initial payload information. This payload can have the Command header of PICC. Here the information is not exchanged with PICC.
    • Buffer Intermediate Payload To buffer intermediate payload information. This payload contains only the Data part for PICC (if any). Here the information is not exchanged with PICC.
    • Buffer Final and Exchange To buffer final payload information. This payload contains only the Data part for PICC (if any). Here the complete buffered information is exchanged to PICC and also receives the information from PICC if available.

  • Chained Exchange
    • Chained Transmission
      • To send any pending payload to DUT.
      • If DUT requires more data, then DUT will respond with Require More Data as status for the current exchange call. The interface should be called for this flag until DUT returns Complete as status.
    • Chained Reception
      • To receive any pending payload from DUT.
      • To start using this flag, DUT will return More Data Available as status during previous reception. Payload should be received until Complete as status is returned by DUT.
Returns
Status code
Return values
PH_ERR_SUCCESSCommand successfully executed.
PH_ERR_INTERFACE_ERRORCommunication error.
PH_ERR_BUFFER_OVERFLOWTransmit data length is longer than the allocated transmit buffer size.
PH_ERR_PROTOCOL_ERRORInvalid frame or unexpected receive data length or command code mismatch.
OtherStatus word returned from the reader after the exchange function.
Parameters
[in]pDataParams[IN] Pointer to this layer parameter structure.
[in]wOption[In] Buffering options to perform exchange. Refer description for more details.
[in]pTxBuff[In] Payload information to be exchanged / buffers based on wOption information.
[in]wTxLen[In] Length of bytes available in pTxBuff buffer.
[out]ppRxBuff[Out] Information provided by PICC.
[out]pRxLen[Out] Length of bytes available in ppRxBuff.

◆ phhalHw_DUT_Cmd_HAL_SetConfig()

phStatus_t phhalHw_DUT_Cmd_HAL_SetConfig ( phhalHw_DUT_DataParams_t pDataParams,
uint16_t  wConfig,
uint16_t  wValue 
)

Set configuration parameter.

Returns
Status code
Return values
PH_ERR_SUCCESSCommand successfully executed.
PH_ERR_INTERFACE_ERRORCommunication error.
PH_ERR_UNSUPPORTED_PARAMETERConfiguration is not supported or invalid.
PH_ERR_INVALID_PARAMETERParameter value is invalid.
PH_ERR_BUFFER_OVERFLOWTransmit data length is longer than the allocated transmit buffer size.
PH_ERR_PROTOCOL_ERRORInvalid frame or unexpected receive data length or command code mismatch.
OtherStatus word returned from the reader after the exchange function.
Parameters
[in]pDataParams[IN] Pointer to this layer parameter structure.
[in]wConfig[In] Configuration Identifier.
[in]wValue[In] Configuration Value.

◆ phhalHw_DUT_Cmd_HAL_GetConfig()

phStatus_t phhalHw_DUT_Cmd_HAL_GetConfig ( phhalHw_DUT_DataParams_t pDataParams,
uint16_t  wConfig,
uint16_t pValue 
)

Get configuration parameter.

Returns
Status code
Return values
PH_ERR_SUCCESSCommand successfully executed.
PH_ERR_INTERFACE_ERRORCommunication error.
PH_ERR_UNSUPPORTED_PARAMETERConfiguration is not supported or invalid.
PH_ERR_INVALID_PARAMETERParameter value is invalid.
PH_ERR_BUFFER_OVERFLOWTransmit data length is longer than the allocated transmit buffer size.
PH_ERR_PROTOCOL_ERRORInvalid frame or unexpected receive data length or command code mismatch.
OtherStatus word returned from the reader after the exchange function.
Parameters
[in]pDataParams[IN] Pointer to this layer parameter structure.
[in]wConfig[In] Configuration Identifier.
[out]pValue[Out] Configuration Value.

◆ phhalHw_DUT_Cmd_HAL_ApplyProtocolSettings()

phStatus_t phhalHw_DUT_Cmd_HAL_ApplyProtocolSettings ( phhalHw_DUT_DataParams_t pDataParams,
uint8_t  bCardType 
)

Apply protocol settings.

To keep the current card type, use PHHAL_HW_CARDTYPE_CURRENT for bCardType.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INTERFACE_ERRORCommunication error.
PH_ERR_INVALID_PARAMETERbCardType is invalid or not supported.
PH_ERR_BUFFER_OVERFLOWTransmit data length is longer than the allocated transmit buffer size.
PH_ERR_PROTOCOL_ERRORInvalid frame or unexpected receive data length or command code mismatch.
Parameters
[in]pDataParams[IN] Pointer to this layer parameter structure.
[in]bCardType[In] Type of card for which the HAL should be configured for. One for the below values.

◆ phhalHw_DUT_Cmd_HAL_Wait()

phStatus_t phhalHw_DUT_Cmd_HAL_Wait ( phhalHw_DUT_DataParams_t pDataParams,
uint8_t  bUnit,
uint16_t  wTimeout 
)

Blocks until the time given by wTimeout elapsed.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INTERFACE_ERRORCommunication error.
PH_ERR_INVALID_PARAMETERbUnit is invalid.
PH_ERR_BUFFER_OVERFLOWTransmit data length is longer than the allocated transmit buffer size.
PH_ERR_PROTOCOL_ERRORInvalid frame or unexpected receive data length or command code mismatch.
Parameters
[in]pDataParams[IN] Pointer to this layer parameter structure.
[in]bUnit[In] Unit of given timeout value. Supported values are
[in]wTimeout[In] Timeout value based on bUnit information.

◆ phhalHw_DUT_Cmd_HAL_MfcAuthenticate()

phStatus_t phhalHw_DUT_Cmd_HAL_MfcAuthenticate ( phhalHw_DUT_DataParams_t pDataParams,
uint8_t  bBlockNo,
uint8_t  bKeyType,
uint8_t pKey,
uint8_t pUid 
)

Perform MIFARE(R) Classic Authentication using a key.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INTERFACE_ERRORCommunication error.
PH_ERR_INVALID_PARAMETERbKeyType is invalid.
PH_ERR_IO_TIMEOUTError in Authentication.
PH_ERR_AUTH_ERRORError in Authentication.
PH_ERR_BUFFER_OVERFLOWTransmit data length is longer than the allocated transmit buffer size.
PH_ERR_PROTOCOL_ERRORInvalid frame or unexpected receive data length or command code mismatch.
Parameters
[in]pDataParams[IN] Pointer to this layer parameter structure.
[in]bBlockNo[In] Block Number on card to Authenticate to.
[in]bKeyType[In] Key Type to use for Authentication.
[in]pKey[In] Key to be used in authentication.
[in]pUid[In] 4 byte Serial number of current cascade level

◆ phhalHw_DUT_Cmd_HAL_Execute()

phStatus_t phhalHw_DUT_Cmd_HAL_Execute ( phhalHw_DUT_DataParams_t pDataParams,
uint8_t  bCmd,
uint16_t  wOption,
uint8_t pTxBuff,
uint16_t  wTxLen,
uint8_t **  ppRxBuff,
uint16_t pRxLen 
)

Perform Command Execution with a PICC.

This command is used to exchange information to PICC and at the same time receives the payload from PICC if available including the Status.

wOption can be one of:

  • Normal Exchange
    • Default To frame and exchange the complete payload information to PICC and also receives the payload from PICC if available.
    • Buffer Initial Payload To buffer initial payload information. This payload can have the Command header of PICC. Here the information is not exchanged with PICC.
    • Buffer Intermediate Payload To buffer intermediate payload information. This payload contains only the Data part for PICC (if any). Here the information is not exchanged with PICC.
    • Buffer Final and Exchange To buffer final payload information. This payload contains only the Data part for PICC (if any). Here the complete buffered information is exchanged to PICC and also receives the information from PICC if available.

  • Chained Exchange
    • Chained Transmission
      • To send any pending payload to DUT.
      • If DUT requires more data, then DUT will respond with Require More Data as status for the current exchange call. The interface should be called for this flag until DUT returns Complete as status.
    • Chained Reception
      • To receive any pending payload from DUT.
      • To start using this flag, DUT will return More Data Available as status during previous reception. Payload should be received until Complete as status is returned by DUT.
Returns
Status code
Return values
PH_ERR_SUCCESSCommand successfully executed.
PH_ERR_INTERFACE_ERRORCommunication error.
PH_ERR_BUFFER_OVERFLOWTransmit data length is longer than the allocated transmit buffer size.
PH_ERR_PROTOCOL_ERRORInvalid frame or unexpected receive data length or command code mismatch.
OtherStatus word returned from the reader after the exchange function.
Parameters
[in]pDataParams[IN] Pointer to this layer parameter structure.
[in]bCmd[IN] Command to be executed on the Reader IC.
[in]wOption[In] Buffering options to perform exchange. Refer description for more details.
[in]pTxBuff[In] Payload information to be exchanged / buffers based on wOption information.
[in]wTxLen[In] Length of bytes available in pTxBuff buffer.
[out]ppRxBuff[Out] Information provided by PICC.
[out]pRxLen[Out] Length of bytes available in ppRxBuff.

◆ phhalHw_DUT_Cmd_HAL_MfcAuthenticateKeyNo()

phStatus_t phhalHw_DUT_Cmd_HAL_MfcAuthenticateKeyNo ( phhalHw_DUT_DataParams_t pDataParams,
uint8_t  bBlockNo,
uint8_t  bKeyType,
uint16_t  wKeyNo,
uint16_t  wKeyVer,
uint8_t pUid 
)

Perform MIFARE(R) Classic Authentication using a key number.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INTERFACE_ERRORCommunication error.
PH_ERR_INVALID_PARAMETERbKeyType, wKeyNo or wKeyVersion is invalid.
PH_ERR_IO_TIMEOUTError in Authentication.
PH_ERR_AUTH_ERRORError in Authentication.
PH_ERR_BUFFER_OVERFLOWTransmit data length is longer than the allocated transmit buffer size.
PH_ERR_PROTOCOL_ERRORInvalid frame or unexpected receive data length or command code mismatch.
Parameters
[in]pDataParams[IN] Pointer to this layer parameter structure.
[in]bBlockNo[In] Block Number on card to Authenticate to.
[in]bKeyType[In] Key Type to use for Authentication.
[in]wKeyNo[In] Key number to be used in authentication.
[in]wKeyVer[In] Key version to be used in authentication.
[in]pUid[In] 4 byte Serial number of current cascade level

◆ phhalHw_DUT_Cmd_HAL_Transmit()

phStatus_t phhalHw_DUT_Cmd_HAL_Transmit ( phhalHw_DUT_DataParams_t pDataParams,
uint16_t  wOption,
uint8_t pTxBuff,
uint16_t  wTxLen 
)

Perform Transmission of data with a PICC.

This command is used to exchange information to PICC and at the same time receives the payload from PICC if available including the Status.

wOption can be one of:

  • Normal Exchange
    • Default To frame and exchange the complete payload information to PICC and also receives the payload from PICC if available.
    • Buffer Initial Payload To buffer initial payload information. This payload can have the Command header of PICC. Here the information is not exchanged with PICC.
    • Buffer Intermediate Payload To buffer intermediate payload information. This payload contains only the Data part for PICC (if any). Here the information is not exchanged with PICC.
    • Buffer Final and Exchange To buffer final payload information. This payload contains only the Data part for PICC (if any). Here the complete buffered information is exchanged to PICC and also receives the information from PICC if available.

  • Chained Exchange
    • Chained Transmission
      • To send any pending payload to DUT.
      • If DUT requires more data, then DUT will respond with Require More Data as status for the current exchange call. The interface should be called for this flag until DUT returns Complete as status.
Returns
Status code
Return values
PH_ERR_SUCCESSCommand successfully executed.
PH_ERR_INTERFACE_ERRORCommunication error.
PH_ERR_BUFFER_OVERFLOWTransmit data length is longer than the allocated transmit buffer size.
PH_ERR_PROTOCOL_ERRORInvalid frame or unexpected receive data length or command code mismatch.
OtherStatus word returned from the reader after the exchange function.
Parameters
[in]pDataParams[IN] Pointer to this layer parameter structure.
[in]wOption[In] Buffering options to perform exchange. Refer description for more details.
[in]pTxBuff[In] Payload information to be exchanged / buffers based on wOption information.
[in]wTxLen[In] Length of bytes available in pTxBuff buffer.

◆ phhalHw_DUT_Cmd_HAL_Receive()

phStatus_t phhalHw_DUT_Cmd_HAL_Receive ( phhalHw_DUT_DataParams_t pDataParams,
uint16_t  wOption,
uint8_t **  ppRxBuff,
uint16_t pRxLen 
)

Perform Reception of Data from a PICC.

This command is used to exchange information to PICC and at the same time receives the payload from PICC if available including the Status.

wOption can be one of:

  • Normal Exchange
    • Default To frame and exchange the complete payload information to PICC and also receives the payload from PICC if available.
    • Buffer Initial Payload To buffer initial payload information. This payload can have the Command header of PICC. Here the information is not exchanged with PICC.
    • Buffer Intermediate Payload To buffer intermediate payload information. This payload contains only the Data part for PICC (if any). Here the information is not exchanged with PICC.
    • Buffer Final and Exchange To buffer final payload information. This payload contains only the Data part for PICC (if any). Here the complete buffered information is exchanged to PICC and also receives the information from PICC if available.

  • Chained Exchange
    • Chained Reception
      • To receive any pending payload from DUT.
      • To start using this flag, DUT will return More Data Available as status during previous reception. Payload should be received until Complete as status is returned by DUT.
Returns
Status code
Return values
PH_ERR_SUCCESSCommand successfully executed.
PH_ERR_INTERFACE_ERRORCommunication error.
PH_ERR_BUFFER_OVERFLOWTransmit data length is longer than the allocated transmit buffer size.
PH_ERR_PROTOCOL_ERRORInvalid frame or unexpected receive data length or command code mismatch.
OtherStatus word returned from the reader after the exchange function.
Parameters
[in]pDataParams[IN] Pointer to this layer parameter structure.
[in]wOption[In] Buffering options to perform exchange. Refer description for more details.
[out]ppRxBuff[Out] Information provided by PICC.
[out]pRxLen[Out] Length of bytes available in ppRxBuff.

◆ phhalHw_DUT_Cmd_HAL_I18000p3m3Inventory()

phStatus_t phhalHw_DUT_Cmd_HAL_I18000p3m3Inventory ( phhalHw_DUT_DataParams_t pDataParams,
uint8_t pSelCmd,
uint8_t  bSelCmdLen,
uint8_t  bNumValidBitsinLastByte,
uint8_t pBeginRndCmd,
uint8_t  bTSprocessing,
uint8_t **  ppRxBuff,
uint16_t pRxLen 
)

ISO 18000p3m3 Inventory command.

Note: This function does ISO18000p3m3 BeginRound Sends an ACK Optionally sends a ReqRN Stores the information related to tag reply in the HAL RX Buffer Continues with NextSlot or else pauses and returns based on the option specified Can return multi card information based on the configuration option and the size of HAL RX Buffer. The bTSprocessing (Time slot processing behavior) can take the following values

  • PHHAL_HW_I18000P3M3_GET_MAX_RESPS - Gets responses from more than one slot limited by the Rx Buffer size and number of slots specified in begin round.
  • PHHAL_HW_I18000P3M3_ONE_TS_ONLY - Gets response for only one time slot. Here the number of time slots should be zero in the begin round command.
  • PHHAL_HW_I18000P3M3_GET_TAG_HANDLE - Gets response for only one time slot. Also send a ReqRN to get the tag handle for this slot. Here the number of time slots should be zero in the begin round command.

The response is a Pointer to a buffer containing the result of the inventory. The buffer may contain the result of one or more timeslots. Each timeslot result has the following structure: 1 Byte time slot status ( 0 ... Tag response available. 'Tag reply length field', 'Valid bits in last byte field' and 'Tag reply field' are present. 1 ... Tag response available. In addition to three field above, 'Tag handle field' also present. 2 ... No tag replied in timeslot. 'Tag reply length field', 'Valid bits in last byte field' and 'Tag reply field', 'Tag Handle' are not present. 3 ... Two or more tags responded in the timeslot. (Collision). Tag Reply Length, valid bits in last byte and tag reply field not present. ) 1 Byte 'Tag reply' Length (1-66) 1 Byte Valid bits in last Byte (0-7, 0 means all bits are valid) 0-66 Bytes Tag reply 0 or 2 Bytes Handle of the tag, in case the field

A typical sequence in which this API is called is given below

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INTERFACE_ERRORCommunication error.
PH_ERR_BUFFER_OVERFLOWTransmit data length is longer than the allocated transmit buffer size.
PH_ERR_PROTOCOL_ERRORInvalid frame or unexpected receive data length or command code mismatch.
PH_ERR_IO_TIMEOUTWhen there is no tag in the field.
PH_ERR_INVALID_PARAMETERIf wrong value specified for bNumValidBits or pBeginRound.
Parameters
[in]pDataParams[IN] Pointer to this layer parameter structure.
[in]pSelCmd[In] ISO 18000p3m3 Select command frame.
[in]bSelCmdLen[In] Select command length in bytes- 1 to 39 bytes.
[in]bNumValidBitsinLastByte[In] Number of valid bits in last byte of pSelCmd.
[in]pBeginRndCmd[In] ISO 18000p3m3 BeginRound command frame. This is 17bits i.e., 3 bytes are expected. CRC5 should not be provided.
[in]bTSprocessing[In] TimeSlot processing behavior.
[out]ppRxBuff[Out] Information provided by ISO18000 tag.
[out]pRxLen[Out] Length of bytes available in ppRxBuff.

◆ phhalHw_DUT_Cmd_HAL_I18000p3m3ResumeInventory()

phStatus_t phhalHw_DUT_Cmd_HAL_I18000p3m3ResumeInventory ( phhalHw_DUT_DataParams_t pDataParams,
uint8_t **  ppRxBuff,
uint16_t pRxLen 
)

ISO 18000p3m3 resume inventory command.

Note: This function is to be called after I18000p3m3 Inventory. This internally calls the ISO 18000p3m3 NextSlot command once or multiple times to get responses from remaining slots.

Resume inventory also returns the response similar to I18000p3m3 Inventory.

A typical sequence in which this API is called is given below

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INTERFACE_ERRORCommunication error.
PH_ERR_BUFFER_OVERFLOWTransmit data length is longer than the allocated transmit buffer size.
PH_ERR_PROTOCOL_ERRORInvalid frame or unexpected receive data length or command code mismatch.
PH_ERR_IO_TIMEOUTWhen there is no tag in the field.
PH_ERR_USE_CONDITIONIf called when the phhalHw_I18000p3m3 was not called previously with bTSprocessing = PHHAL_HW_I18000P3M3_GET_MAX_RESPS.
Parameters
[in]pDataParams[IN] Pointer to this layer parameter structure.
[out]ppRxBuff[Out] Information provided ISO18000 tag.
[out]pRxLen[Out] Length of bytes available in ppRxBuff.