NXP NFC Reader Library  v4.040.05.011646

These Components implement the ISO/IEC 14443-3 Type-B contactless protocol. More...

Collaboration diagram for ISO/IEC 14443-3B:

Modules

 Component : Software
 

Functions

phStatus_t phpalI14443p3b_SetConfig (void *pDataParams, uint16_t wConfig, uint16_t wValue)
 Set configuration value. More...
 
phStatus_t phpalI14443p3b_GetConfig (void *pDataParams, uint16_t wConfig, uint16_t *pValue)
 Get configuration value. More...
 
phStatus_t phpalI14443p3b_RequestB (void *pDataParams, uint8_t bNumSlots, uint8_t bAfi, uint8_t bExtAtqb, uint8_t *pAtqb, uint8_t *pAtqbLen)
 Perform a ISO14443-3B Request command. More...
 
phStatus_t phpalI14443p3b_WakeUpB (void *pDataParams, uint8_t bNumSlots, uint8_t bAfi, uint8_t bExtAtqb, uint8_t *pAtqb, uint8_t *pAtqbLen)
 Perform a ISO14443-3B Wakeup command. More...
 
phStatus_t phpalI14443p3b_SlotMarker (void *pDataParams, uint8_t bSlotNumber, uint8_t *pAtqb, uint8_t *pAtqbLen)
 Perform a ISO14443-3B Slot-MARKER command. More...
 
phStatus_t phpalI14443p3b_HaltB (void *pDataParams)
 Perform a ISO14443-3B Halt command. More...
 
phStatus_t phpalI14443p3b_Attrib (void *pDataParams, uint8_t *pAtqb, uint8_t bAtqbLen, uint8_t bFsdi, uint8_t bCid, uint8_t bDri, uint8_t bDsi, uint8_t *pMbli)
 Perform a ISO14443-3B Attrib command. More...
 
phStatus_t phpalI14443p3b_ActivateCard (void *pDataParams, uint8_t *pPupi, uint8_t bPupiLength, uint8_t bNumSlots, uint8_t bAfi, uint8_t bExtAtqb, uint8_t bFsdi, uint8_t bCid, uint8_t bDri, uint8_t bDsi, uint8_t *pAtqb, uint8_t *pAtqbLen, uint8_t *pMbli, uint8_t *pMoreCardsAvailable)
 Perform ISO14443-3B ReqB or WupB and Anticollision/Select commands for all cascade levels. More...
 
phStatus_t phpalI14443p3b_Exchange (void *pDataParams, uint16_t wOption, uint8_t *pTxBuffer, uint16_t wTxLength, uint8_t **ppRxBuffer, uint16_t *pRxLength)
 Perform ISO14443-3B Data Exchange with Picc. More...
 
phStatus_t phpalI14443p3b_GetSerialNo (void *pDataParams, uint8_t *pPupi)
 Retrieve the serial number. More...
 
phStatus_t phpalI14443p3b_SetSerialNo (void *pDataParams, uint8_t *pPupi)
 This function will update PUPI in this layer's parameter structure. More...
 
phStatus_t phpalI14443p3b_SetHigherLayerInf (void *pDataParams, uint8_t *pTxBuffer, uint16_t wTxLength, uint8_t *pRxBuffer, uint16_t wRxBufSize)
 Set higher layer information. More...
 
phStatus_t phpalI14443p3b_GetHigherLayerResp (void *pDataParams, uint8_t **ppRxBuffer, uint16_t *pRxLength)
 Get higher layer response. More...
 
phStatus_t phpalI14443p3b_GetProtocolParams (void *pDataParams, uint8_t *pCidEnabled, uint8_t *pCid, uint8_t *pNadSupported, uint8_t *pFwi, uint8_t *pFsdi, uint8_t *pFsci)
 Retrieve the ISO14443-3B protocol parameters. More...
 

14443-3B constant definitions

#define PHPAL_I14443P3B_CONFIG_ATTRIB_PARAM1   0x0000U
 Set or get the AttribB param1 byte. More...
 

Configuration

#define PHPAL_I14443P3B_CONFIG_OPE_MODE   0x0001U
 Configure Operation Mode for this Layer. More...
 
#define PHPAL_I14443P3B_CONFIG_POLL_CMD   0x0002U
 Configure which command to be used for Type B Polling. More...
 
#define PHPAL_I14443P3B_CONFIG_ATTRIB_RETRY_COUNT   0x0003U
 Configure retry count for ATTRIB command. More...
 

Poll Command

#define PHPAL_I14443P3B_USE_REQB   0x00U
 Indicate REQB command to be used for Type B Polling.
 
#define PHPAL_I14443P3B_USE_WUPB   0x01U
 Indicate WakeupB command to be used for Type B Polling.
 

DRI/DSI Values

#define PHPAL_I14443P3B_DATARATE_106   0x00U
 DRI/DSI value for 106 kBit/s.
 
#define PHPAL_I14443P3B_DATARATE_212   0x01U
 DRI/DSI value for 212 kBit/s.
 
#define PHPAL_I14443P3B_DATARATE_424   0x02U
 DRI/DSI value for 424 kBit/s.
 
#define PHPAL_I14443P3B_DATARATE_848   0x03U
 DRI/DSI value for 848 kBit/s.
 
#define PHPAL_I14443P3B_DATARATE_FORCE   0x80U
 Flag that forces the use of the given baud rates.
 

Attrib Command Retry Values

#define PHPAL_I14443P3B_ATTRIB_RETRY_MAX   1
 Maximum retry value of ATTRIB during transmission and timeout error. More...
 
#define PHPAL_I14443P3B_ATTRIB_RETRY_MIN   0
 Minimum retry value of ATTRIB during transmission and timeout error. More...
 

Detailed Description

These Components implement the ISO/IEC 14443-3 Type-B contactless protocol.

Note: The "Timing before the PCD SOF" (see 7.1.7, ISO/IEC 14443-3:2009(E)) is mandatory and is neither implemented here nor implemented in every Hardware Abstraction Layer layer.
Make sure that either the used HAL or the used application does comply to this rule.

Macro Definition Documentation

§ PHPAL_I14443P3B_CONFIG_ATTRIB_PARAM1

#define PHPAL_I14443P3B_CONFIG_ATTRIB_PARAM1   0x0000U

Set or get the AttribB param1 byte.

§ PHPAL_I14443P3B_CONFIG_OPE_MODE

#define PHPAL_I14443P3B_CONFIG_OPE_MODE   0x0001U

Configure Operation Mode for this Layer.


Possible values are
RD_LIB_MODE_EMVCO,
RD_LIB_MODE_NFC,
RD_LIB_MODE_ISO,
Default value is RD_LIB_MODE_NFC.

§ PHPAL_I14443P3B_CONFIG_POLL_CMD

#define PHPAL_I14443P3B_CONFIG_POLL_CMD   0x0002U

Configure which command to be used for Type B Polling.


Possible values are
PHPAL_I14443P3B_USE_WUPB,
PHPAL_I14443P3B_USE_REQB,
Default value is PHPAL_I14443P3B_USE_REQB.

§ PHPAL_I14443P3B_CONFIG_ATTRIB_RETRY_COUNT

#define PHPAL_I14443P3B_CONFIG_ATTRIB_RETRY_COUNT   0x0003U

Configure retry count for ATTRIB command.


Possible values are
PHPAL_I14443P3B_ATTRIB_RETRY_MIN,
PHPAL_I14443P3B_ATTRIB_RETRY_MAX,
Default value is PHPAL_I14443P3B_ATTRIB_RETRY_MAX.
For mode RD_LIB_MODE_EMVCO retry count should be 1.

§ PHPAL_I14443P3B_ATTRIB_RETRY_MAX

#define PHPAL_I14443P3B_ATTRIB_RETRY_MAX   1

Maximum retry value of ATTRIB during transmission and timeout error.

§ PHPAL_I14443P3B_ATTRIB_RETRY_MIN

#define PHPAL_I14443P3B_ATTRIB_RETRY_MIN   0

Minimum retry value of ATTRIB during transmission and timeout error.

Function Documentation

§ phpalI14443p3b_SetConfig()

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

Set configuration value.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_PROTOCOL_ERRORInvalid response received.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layers parameter structure.
[in]wConfigConfiguration Identifier.
[in]wValueConfiguration Value.

§ phpalI14443p3b_GetConfig()

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

Get configuration value.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_PROTOCOL_ERRORInvalid response received.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layers parameter structure.
[in]wConfigConfiguration Identifier.
[out]pValueConfiguration Value.

§ phpalI14443p3b_RequestB()

phStatus_t phpalI14443p3b_RequestB ( void *  pDataParams,
uint8_t  bNumSlots,
uint8_t  bAfi,
uint8_t  bExtAtqb,
uint8_t pAtqb,
uint8_t pAtqbLen 
)

Perform a ISO14443-3B Request command.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_PROTOCOL_ERRORInvalid response received.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layers parameter structure.
[in]bNumSlotsNumber of slots.
[in]bAfiAFI; Application Family Indentifier.
[in]bExtAtqbEnable Extended AtqB.
[out]pAtqbAtqB; uint8_t[13].
[out]pAtqbLenlength of ATQB (12/13 bytes).

§ phpalI14443p3b_WakeUpB()

phStatus_t phpalI14443p3b_WakeUpB ( void *  pDataParams,
uint8_t  bNumSlots,
uint8_t  bAfi,
uint8_t  bExtAtqb,
uint8_t pAtqb,
uint8_t pAtqbLen 
)

Perform a ISO14443-3B Wakeup command.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_PROTOCOL_ERRORInvalid response received.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layers parameter structure.
[in]bNumSlotsNumber of slots.
[in]bAfiAFI; Application Family Indentifier.
[in]bExtAtqbEnable Extended AtqB.
[out]pAtqbAtqB; uint8_t[12/13].
[out]pAtqbLenlength of ATQB (12/13 bytes).

§ phpalI14443p3b_SlotMarker()

phStatus_t phpalI14443p3b_SlotMarker ( void *  pDataParams,
uint8_t  bSlotNumber,
uint8_t pAtqb,
uint8_t pAtqbLen 
)

Perform a ISO14443-3B Slot-MARKER command.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_PROTOCOL_ERRORInvalid response received.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layers parameter structure.
[in]bSlotNumberSlot Number.
[out]pAtqbAtqB; uint8_t[12/13].
[out]pAtqbLenlength of ATQB (12/13 bytes).

§ phpalI14443p3b_HaltB()

phStatus_t phpalI14443p3b_HaltB ( void *  pDataParams)

Perform a ISO14443-3B Halt command.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_PROTOCOL_ERRORInvalid response received.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layers parameter structure.

§ phpalI14443p3b_Attrib()

phStatus_t phpalI14443p3b_Attrib ( void *  pDataParams,
uint8_t pAtqb,
uint8_t  bAtqbLen,
uint8_t  bFsdi,
uint8_t  bCid,
uint8_t  bDri,
uint8_t  bDsi,
uint8_t pMbli 
)

Perform a ISO14443-3B Attrib command.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_PROTOCOL_ERRORInvalid response received.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layers parameter structure.
[in]pAtqbAtqb from ReqB/WupB; uint8_t[12/13].
[in]bAtqbLenLength of Atqb.
[in]bFsdiFrame Size Integer; 0-8.
[in]bCidCard Identifier; 0-14.
[in]bDriDivisor Receive (PCD to PICC) Integer; 0-3.
[in]bDsiDivisor Send (PICC to PCD) Integer; 0-3.
[out]pMbliMBLI byte; uint8_t.

§ phpalI14443p3b_ActivateCard()

phStatus_t phpalI14443p3b_ActivateCard ( void *  pDataParams,
uint8_t pPupi,
uint8_t  bPupiLength,
uint8_t  bNumSlots,
uint8_t  bAfi,
uint8_t  bExtAtqb,
uint8_t  bFsdi,
uint8_t  bCid,
uint8_t  bDri,
uint8_t  bDsi,
uint8_t pAtqb,
uint8_t pAtqbLen,
uint8_t pMbli,
uint8_t pMoreCardsAvailable 
)

Perform ISO14443-3B ReqB or WupB and Anticollision/Select commands for all cascade levels.

If bLenUidIn is '0' –> CardUid not given, a ReqB is performed. If CardUid is given, a WupB is performed.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_PROTOCOL_ERRORInvalid response received.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layers parameter structure.
[in]pPupiPointer to the known PUPI; uint8_t[4].
[in]bPupiLengthLength of given PUPI, only a value of 0 or 4 is allowed.
[in]bNumSlotsNumber of slots.
[in]bAfiAFI; Application Family Indentifier.
[in]bExtAtqbEnable Extended AtqB.
[in]bFsdiFrame Size Integer; 0-8.
[in]bCidCard Identifier; 0-14.
[in]bDriDivisor Receive (PCD to PICC) Integer; 0-3.
[in]bDsiDivisor Send (PICC to PCD) Integer; 0-3.
[out]pAtqbAtqB; uint8_t[13].
[out]pAtqbLenlength of ATQB (12/13 bytes).
[out]pMbliMBLI byte; uint8_t.
[out]pMoreCardsAvailableWhether there are more cards in the field or not; uint8_t.

§ phpalI14443p3b_Exchange()

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

Perform ISO14443-3B Data Exchange with 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 underlying component.
Parameters
[in]pDataParamsPointer to this layers parameter structure.
[in]wOptionOption parameter.
[in]pTxBufferData to transmit.
[in]wTxLengthLength of data to transmit.
[out]ppRxBufferPointer to received data.
[out]pRxLengthnumber of received data bytes.

§ phpalI14443p3b_GetSerialNo()

phStatus_t phpalI14443p3b_GetSerialNo ( void *  pDataParams,
uint8_t pPupi 
)

Retrieve the serial number.

This function will provide 4 byte PUPI.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_USE_CONDITIONNo PUPI available.
Parameters
[in]pDataParamsPointer to this layers parameter structure.
[out]pPupiMost recent PUPI.

§ phpalI14443p3b_SetSerialNo()

phStatus_t phpalI14443p3b_SetSerialNo ( void *  pDataParams,
uint8_t pPupi 
)

This function will update PUPI in this layer's parameter structure.

This function must be called with valid PUPI. Once set the subsequent type B commands use this PUPI.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
Parameters
[in]pDataParamsPointer to this layers parameter structure.
[in]pPupi4 byte PUPI.

§ phpalI14443p3b_SetHigherLayerInf()

phStatus_t phpalI14443p3b_SetHigherLayerInf ( void *  pDataParams,
uint8_t pTxBuffer,
uint16_t  wTxLength,
uint8_t pRxBuffer,
uint16_t  wRxBufSize 
)

Set higher layer information.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_USE_CONDITIONFeature not available.
Parameters
[in]pDataParamsPointer to this layers parameter structure.
[in]pTxBufferHigher layer Information; Can be NULL if /c wTxLength is 0.
[in]wTxLengthLength of the Higher layer Information. Can be 0.
[in]pRxBufferHigher layer response buffer.
[in]wRxBufSizeSize of Higher layer response buffer.

§ phpalI14443p3b_GetHigherLayerResp()

phStatus_t phpalI14443p3b_GetHigherLayerResp ( void *  pDataParams,
uint8_t **  ppRxBuffer,
uint16_t pRxLength 
)

Get higher layer response.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_USE_CONDITIONFeature not available.
Parameters
[in]pDataParamsPointer to this layers parameter structure.
[out]ppRxBufferHigher layer response.
[out]pRxLengthLength of Higher layer response.

§ phpalI14443p3b_GetProtocolParams()

phStatus_t phpalI14443p3b_GetProtocolParams ( void *  pDataParams,
uint8_t pCidEnabled,
uint8_t pCid,
uint8_t pNadSupported,
uint8_t pFwi,
uint8_t pFsdi,
uint8_t pFsci 
)

Retrieve the ISO14443-3B protocol parameters.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
Parameters
[in]pDataParamsPointer to this layers parameter structure.
[out]pCidEnabledUnequal '0' if Card Identifier is enabled.
[out]pCidCard Identifier.
[out]pNadSupportedNode Address Support; Unequal '0' if supported.
[out]pFwiFrame Waiting Integer.
[out]pFsdiPCD Frame Size Integer; 0-8.
[out]pFsciPICC Frame Size Integer; 0-8.