Example code to configure HAL and BAL for Simulator.
#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; \
}
uint8_t aPortName[] = {
'1',
'2',
'7',
'.',
'0',
'.',
'0',
'.',
'1',
'\0',
'1',
'5',
'2',
'0',
'0',
'\0',
'0',
'0',
'0',
'1',
'\0'};
void* pBal_Generic = NULL;
void* pHal_Generic = NULL;
wStatus =
phKeyStore_Sw_Init ( &stKeyStore,
sizeof ( stKeyStore ), aKeyEntry, 0xFF, aKeyVersionPair, 0x03,
aKeyUsageCounter, 0xFF );
CHECK_SUCCESS ( wStatus );
aTx_SocketBuffer, sizeof ( aRx_SocketBuffer ), aRx_SocketBuffer );
CHECK_SUCCESS ( wStatus );
CHECK_SUCCESS ( wStatus );
CHECK_SUCCESS ( wStatus );
wStatus =
phhalHw_RdCardSim_Init ( &stHal_Sim,
sizeof ( stHal_Sim ), &stBal_Socket, &stKeyStore, aTx_SimBuffer,
sizeof ( aTx_SimBuffer ), aRx_SimBuffer, sizeof ( aRx_SimBuffer ), aInt_SimBuffer, sizeof ( aInt_SimBuffer ) );
CHECK_SUCCESS ( wStatus );
pBal_Generic = &stBal_Socket;
pHal_Generic = &stHal_Sim;