NXP Reader Library  v17.1.0.2535

These Components implement the Felica (contactless) protocol. More...

Collaboration diagram for Felica:

Modules

 Component : Software
 

Functions

phStatus_t phpalFelica_ReqC (void *pDataParams, uint8_t *pSystemCode, uint8_t bNumTimeSlots, uint8_t *pRxBuffer)
 Perform the Felica ReqC command. More...
 
phStatus_t phpalFelica_ActivateCard (void *pDataParams, uint8_t *pIDmPMm, uint8_t bIDmPMmLength, uint8_t *pSystemCode, uint8_t bNumTimeSlots, uint8_t *pRxBuffer, uint8_t *pRxLength, uint8_t *pMoreCardsAvailable)
 This command activates a Felica card. More...
 
phStatus_t phpalFelica_Exchange (void *pDataParams, uint16_t wOption, uint16_t wN, uint8_t *pTxBuffer, uint16_t wTxLength, uint8_t **ppRxBuffer, uint16_t *pRxLength)
 Exchange data with the Picc. More...
 
phStatus_t phpalFelica_GetSerialNo (void *pDataParams, uint8_t *pUidOut, uint8_t *pLenUidOut)
 As the card receives the Get Serial Number command, it shall respond with that one. More...
 

Lengths

#define PHPAL_FELICA_IDM_LENGTH   8U
 UID length in bytes.
 
#define PHPAL_FELICA_PMM_LENGTH   8U
 PMm length in bytes.
 
#define PHPAL_FELICA_BLOCK_LENGTH   4U
 Block length in bytes.
 
#define PHPAL_FELICA_PAGE_LENGTH   16U
 Number of bytes per page.
 
#define PHPAL_FELICA_ATQC_LENGTH   17U
 Length of ATQC.
 
#define PHPAL_FELICA_TXLENGTH_MAX   254U
 Maximum length of a transmission package.
 

Definitions of the time slots for the ReqC command

#define PHPAL_FELICA_NUMSLOTS_1   0x00
 Value for bNumSlots = 1.
 
#define PHPAL_FELICA_NUMSLOTS_2   0x01
 Value for bNumSlots = 2.
 
#define PHPAL_FELICA_NUMSLOTS_4   0x03
 Value for bNumSlots = 4.
 
#define PHPAL_FELICA_NUMSLOTS_8   0x07
 Value for bNumSlots = 8.
 
#define PHPAL_FELICA_NUMSLOTS_16   0x0F
 Value for bNumSlots = 16.
 

Detailed Description

These Components implement the Felica (contactless) protocol.

Function Documentation

◆ phpalFelica_ReqC()

phStatus_t phpalFelica_ReqC ( void *  pDataParams,
uint8_t pSystemCode,
uint8_t  bNumTimeSlots,
uint8_t pRxBuffer 
)

Perform the Felica ReqC command.

Note: This function waits until all cards in all timeslots have had time to reply even though only the first response is returned.
The formula used is 1208us * (n-1) according to JIS X 6319-4:2005.

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]pSystemCode[In] System-Code; uint8_t[2].
[in]bNumTimeSlots[In] Number of timeslots to use. Refer to e.g. PHPAL_FELICA_NUMSLOTS_1 for valid values.
[out]pRxBuffer[Out] 8 bytes IDm + 8 bytes PMm; uint8_t[16].

◆ phpalFelica_ActivateCard()

phStatus_t phpalFelica_ActivateCard ( void *  pDataParams,
uint8_t pIDmPMm,
uint8_t  bIDmPMmLength,
uint8_t pSystemCode,
uint8_t  bNumTimeSlots,
uint8_t pRxBuffer,
uint8_t pRxLength,
uint8_t pMoreCardsAvailable 
)

This command activates a Felica card.

Note: If an IDm is passed to this function, it is stored as the current IDm and no real activation is done.

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]pIDmPMm[In] IDm followed by PMm; If supplied it is stored and no real activation is done.
[in]bIDmPMmLength[In] IDm length; 0 or 16.
[in]pSystemCode[In] System-Code; uint8_t[2].
[in]bNumTimeSlots[In] Number of timeslots to use. Refer to e.g. PHPAL_FELICA_NUMSLOTS_1 for valid values.
[out]pRxBuffer[Out] 8 bytes NFCID2 + 8 bytes PAD; uint8_t[16].
[out]pRxLength[Out] Length of received data. 0 or 16.
[out]pMoreCardsAvailable[Out] Whether there are more cards in the field or not; uint8_t.

◆ phpalFelica_Exchange()

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

Exchange data with the 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]wN[In] N to calulate the response timeout.
[in]pTxBuffer[In] Data to transmit; Length and IDm is added automatically.
[in]wTxLength[In] Length of data to transmit.
[out]ppRxBuffer[Out] Pointer to received data; Length, response code and IDm are removed automatically.
[out]pRxLength[Out] number of received data bytes.

◆ phpalFelica_GetSerialNo()

phStatus_t phpalFelica_GetSerialNo ( void *  pDataParams,
uint8_t pUidOut,
uint8_t pLenUidOut 
)

As the card receives the Get Serial Number command, it shall respond with that one.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_USE_CONDITIONNo Serial number available at the moment.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[out]pUidOut[Out] Last Uid (IDm + PMm); uint8_t[16].
[out]pLenUidOut[Out] Length of Uid; 0 or 16.