Renesas PTX1xxR IoT-Reader API (non-OS) Version 7.3.1
Renesas Software Stack for IoT-Reader Applications (non-OS)
Data Structures | Typedefs | Enumerations | Functions
Collaboration diagram for PTX HCE API:

Data Structures

struct  ptxHce_DiscConfig_t
 HCE RF-Discovery Configuration for Listen-Mode. More...
 
struct  ptxHce_EventRecord_t
 HCE Event Record Type. More...
 
struct  ptxHce_EventQueue_t
 HCE Event Queue. More...
 
struct  ptxHce
 HCE Main Structure (Context). More...
 

Typedefs

typedef enum ptxHce_EventType ptxHce_EventType_t
 HCE Event Identifiers.
 
typedef struct ptxHce ptxHce_t
 HCE Main Structure (Context).
 

Enumerations

enum  ptxHce_RfProtocol_t { HceRfProt_Undefined = 0x00 , HceRfProt_T2T = 0x02 , HceRfProt_IsoDep = 0x04 }
 HCE RF-Protocol Type(s)
 
enum  ptxHce_EventQueueDimensions_t { e_MaxNrOfEventRecords = 32 , e_SizeOfShortMsgBuffer = 3 , e_SizeOfActivationBuffer = 16 }
 HCE Event Queue Management (Dimensions)
 
enum  ptxHce_EventQueueRanges_t { e_EvtRecordIndexMin = 0 , e_EvtRecordIndexMax = e_MaxNrOfEventRecords-1 , e_EvtMaxNrOfRecords , e_EvtRecIndexNotSet }
 HCE Event Queue Management (Ranges)
 
enum  ptxHce_EventType {
  HceEvent_ExtFieldOn , HceEvent_ExtFieldOff , HceEvent_Activated_ListenA , HceEvent_Data ,
  HceEvent_Deactivated , HceEvent_NoEvent
}
 HCE Event Identifiers.
 

Functions

ptxStatus_t ptxHce_Init (ptxHce_t *hce, struct ptxPlat *plat, struct ptxNSC *nsc, uint8_t *appRxBuffer, uint16_t appRxBufferSize)
 This function initializes the Host Card Emulation Component (HCE).
 
ptxStatus_t ptxHce_Deinit (ptxHce_t *hce)
 This function De-initializes the Host Card Emulation Component.
 
ptxStatus_t ptxHce_Get_Event (ptxHce_t *hce, ptxHce_EventRecord_t **event)
 This function allows the user to request latest event notification data received from the PTX card emulation device.
 
ptxStatus_t ptxHce_Send_Data (ptxHce_t *hce, uint8_t *tx, uint32_t txLength)
 This function allows the currently activated card to send data to a nearby card reader.
 
ptxStatus_t ptxHce_ReserveEventRecord (ptxHce_t *hce, ptxHce_EventRecord_t **evtRecord, uint16_t *evtRecordIndex)
 Reserves an Event Record at the Tail of the Event Queue.
 
ptxStatus_t ptxHce_AddNewEventPending (ptxHce_t *hce, uint16_t recordIndex)
 Adds a new pending Event Record at the Tail of the Event Queue.
 

NSC DEACTIVATE-Reasons.

#define PTX_HCE_DEACTIVATE_REASON_DESELECT   (uint8_t)0x01
 
#define PTX_HCE_DEACTIVATE_REASON_RELEASE   (uint8_t)0x02
 
#define PTX_HCE_DEACTIVATE_REASON_FIELD_OFF   (uint8_t)0x03
 

Detailed Description

Macro Definition Documentation

◆ PTX_HCE_DEACTIVATE_REASON_DESELECT

#define PTX_HCE_DEACTIVATE_REASON_DESELECT   (uint8_t)0x01

HCE Deactivate reason: Deselect

◆ PTX_HCE_DEACTIVATE_REASON_FIELD_OFF

#define PTX_HCE_DEACTIVATE_REASON_FIELD_OFF   (uint8_t)0x03

HCE Deactivate reason: Field off

◆ PTX_HCE_DEACTIVATE_REASON_RELEASE

#define PTX_HCE_DEACTIVATE_REASON_RELEASE   (uint8_t)0x02

HCE Deactivate reason: Release

Function Documentation

◆ ptxHce_AddNewEventPending()

ptxStatus_t ptxHce_AddNewEventPending ( ptxHce_t * hce,
uint16_t recordIndex )

Adds a new pending Event Record at the Tail of the Event Queue.

Parameters
[in]hcePointer to an initialized instance of the HCE component.
[out]recordIndexPointer to the Index of the added Event
Returns
Status Indicating whether the operation was successful. See ptxStatus_t.

◆ ptxHce_Deinit()

ptxStatus_t ptxHce_Deinit ( ptxHce_t * hce)

This function De-initializes the Host Card Emulation Component.

Parameters
[in]hcePointer to an initialized instance of the HCE component.
Returns
Status Indicating whether the operation was successful. See ptxStatus_t.

◆ ptxHce_Get_Event()

ptxStatus_t ptxHce_Get_Event ( ptxHce_t * hce,
ptxHce_EventRecord_t ** event )

This function allows the user to request latest event notification data received from the PTX card emulation device.

GET EVENT

Events relevant to the HCE application are;

  • a remote RF field has been detected or lost,
  • a remote RF device has been detected (discovered),
  • a remote RF device previously detected has now been activated,
  • a remote RF device previously activated has now been deactivated,
  • an error has occurred in the PTX subsystem,
  • debug information regarding the NSC stack is available.
  • an RF data message has been received.
Parameters
[in]hcePointer to an initialized instance of the HCE component.
[in,out]eventReference to an event record supplied by the AP into which event details can be entered.
Returns
Status Indicating whether the operation was successful. See ptxStatus_t.

◆ ptxHce_Init()

ptxStatus_t ptxHce_Init ( ptxHce_t * hce,
struct ptxPlat * plat,
struct ptxNSC * nsc,
uint8_t * appRxBuffer,
uint16_t appRxBufferSize )

This function initializes the Host Card Emulation Component (HCE).

Parameters
[in]hcePointer to an allocated instance of the HCE component.
[in]platPointer to an initialized instance of the PLAT component.
[in]nscPointer to an initialized instance of the NSC component.
[in]appRxBufferPointer to an application buffer which is used to receive incoming RF-data.
[in]appRxBufferSizeSize of the application buffer.
Returns
Status Indicating whether the operation was successful. See ptxStatus_t.

◆ ptxHce_ReserveEventRecord()

ptxStatus_t ptxHce_ReserveEventRecord ( ptxHce_t * hce,
ptxHce_EventRecord_t ** evtRecord,
uint16_t * evtRecordIndex )

Reserves an Event Record at the Tail of the Event Queue.

Parameters
[in]hcePointer to an initialized instance of the HCE component.
[in]evtRecordReference to the Event Record to be reserved at the end of the Event Queue
[out]evtRecordIndexIndex of the reserved event
Returns
Status Indicating whether the operation was successful. See ptxStatus_t.

◆ ptxHce_Send_Data()

ptxStatus_t ptxHce_Send_Data ( ptxHce_t * hce,
uint8_t * tx,
uint32_t txLength )

This function allows the currently activated card to send data to a nearby card reader.

SEND DATA

  • this is not a blocking function, which means that it will return to the caller immediately after the transmit data has been configured for sending in the serial communications layer.
Note
In case the ISO-DEP protocol (according to ISO 14443-4) is used, the system takes internally care of the timeout when the reader communicates with a card depending on the information which was exchanged during activation (e.g. ATS for Type-A or ATQB for Type-B). In this case the caller has still to provide a meaningful value (e.g. multiple seconds)! If a card reported a max. timeout of less than a second, the function will return after this timeout has expired even if the timeout parameter has been set to e.g. 5 seconds.
Parameters
[in]hcePointer to an initialized instance of the HCE component.
[in]txUser buffer containing the 'raw' RF data message to send.
[in]txLengthLength of data to send which is the actual size of the transmit buffer.
Returns
Status Indicating whether the operation was successful. See ptxStatus_t.