NXP Reader Library  v17.1.0.2535
HAL Initialization for Pegoda 2 (RD710)

Example code to configure HAL and BAL for Pegoda 2 (RD710) reader. More...

Collaboration diagram for HAL Initialization for Pegoda 2 (RD710):

Modules

 RD710 Initialization
 Example code to configure PAL 3A, 4A, 4, MIFARE and SLI15693 to work in RD710 mode. This is valid for RD710 / CM1 reader only.
 
 Software Initialization
 Example code to configure PAL 3A, 4A, 4, MIFARE and SLI15693 to work in software mode.
 

Detailed Description

Example code to configure HAL and BAL for Pegoda 2 (RD710) reader.

#define CHECK_SUCCESS(x) \
if ( (x) != PH_ERR_SUCCESS ) \
{ \
printf ( "\n\n" ); \
printf ( "An error occurred: (0x%04X)\n", (x) ); \
printf ( "Pressing any key will exit the demo.\n" ); \
_getch (); \
return 0; \
}
/* Variables */
phStatus_t wStatus = 0;
uint8_t aAtr[256];
uint8_t aTx_HalBuffer[512];
uint8_t aRx_HalBuffer[512];
void* pBal_Generic = NULL;
void* pHal_Generic = NULL;
/* Initialize the reader BAL component */
wStatus = phbalReg_PcscWin_Init ( &stBal_Rd710, sizeof ( stBal_Rd710 ), aAtr, 256 );
CHECK_SUCCESS ( wStatus );
/* Set the BAL Communication Configuration values */
CHECK_SUCCESS ( wStatus );
CHECK_SUCCESS ( wStatus );
/* Connect to the first reader out of the list. */
wStatus = phbalReg_SetPort ( &stBal_Rd710, ( uint8_t * ) "NXP Pegoda N CL 0 0" );
CHECK_SUCCESS ( wStatus );
/* Open the reader port. */
wStatus = phbalReg_OpenPort ( &stBal_Rd710 );
CHECK_SUCCESS ( wStatus );
/* Configure to use Pegoda 2 mode. Enable the below two lines only if the firmware version is higher than 02.02.07 */
/* wStatus = phbalReg_SetConfig( &stBal_Rd710, PHBAL_REG_PCSCWIN_CONFIG_PEGODA2_MODE, PH_ON);
* CHECK_SUCCESS ( wStatus ); */
/* Initialize the reader HAL component. */
wStatus = phhalHw_Rd710_Init ( &stHal_Rd710, sizeof ( stHal_Rd710 ), &stBal_Rd710, 0, aTx_HalBuffer, sizeof ( aTx_HalBuffer ),
aRx_HalBuffer, sizeof ( aRx_HalBuffer ) );
CHECK_SUCCESS ( wStatus );
/* Standard Rd710 Cmd Init. */
wStatus = ( phStatus_t ) phhalHw_Rd710_Cmd_InitReader ( &stHal_Rd710 );
CHECK_SUCCESS ( wStatus );
/* Update the generic components. */
pBal_Generic = &stBal_Rd710;
pHal_Generic = &stHal_Rd710;
phbalReg_PcscWin_DataParams_t
PCSC (Windows) BAL parameter structure.
Definition: phbalReg.h:522
phhalHw_Rd710_Init
phStatus_t phhalHw_Rd710_Init(phhalHw_Rd710_DataParams_t *pDataParams, uint16_t wSizeOfDataParams, void *pBalDataParams, uint8_t bSlotNumber, uint8_t *pTxBuffer, uint16_t wTxBufSize, uint8_t *pRxBuffer, uint16_t wRxBufSize)
Initialise the HAL component.
phhalHw_Rd710_Cmd_InitReader
phStatus_t phhalHw_Rd710_Cmd_InitReader(phhalHw_Rd710_DataParams_t *pDataParams)
The function starts the reader in direct PCSC mode and initializes the following stack components: HA...
phStatus_t
uint16_t phStatus_t
phcsBfl_Status_t is a signed short value, using the positive range.
Definition: ph_TypeDefs.h:158
PHBAL_REG_PCSCWIN_VALUE_PROTOCOL_UNDEFINED
#define PHBAL_REG_PCSCWIN_VALUE_PROTOCOL_UNDEFINED
UNDEFINED protocol.
Definition: phbalReg.h:563
phhalHw_Rd710_DataParams_t
Rd710 HAL parameter structure.
Definition: phhalHw.h:930
phbalReg_SetPort
phStatus_t phbalReg_SetPort(void *pDataParams, uint8_t *pPortName)
Select Port to be used.
PHBAL_REG_PCSCWIN_VALUE_SHARE_DIRECT
#define PHBAL_REG_PCSCWIN_VALUE_SHARE_DIRECT
DIRECT access.
Definition: phbalReg.h:566
phbalReg_SetConfig
phStatus_t phbalReg_SetConfig(void *pDataParams, uint16_t wConfig, uint16_t wValue)
Set configuration parameter.
PHBAL_REG_PCSCWIN_CONFIG_SHARE
#define PHBAL_REG_PCSCWIN_CONFIG_SHARE
Used Access mode; e.g.
Definition: phbalReg.h:550
phbalReg_OpenPort
phStatus_t phbalReg_OpenPort(void *pDataParams)
Open communication port.
phbalReg_PcscWin_Init
phStatus_t phbalReg_PcscWin_Init(phbalReg_PcscWin_DataParams_t *pDataParams, uint16_t wSizeOfDataParams, uint8_t *pAtrBuffer, uint16_t wAtrBufSize)
Initialise the PCSC BAL component.
PHBAL_REG_PCSCWIN_CONFIG_PROTOCOL
#define PHBAL_REG_PCSCWIN_CONFIG_PROTOCOL
Used Protocol; e.g.
Definition: phbalReg.h:549
uint8_t
unsigned char uint8_t
8 bit unsigned integer
Definition: ph_TypeDefs.h:56