Copyright IXXAT Automation GmbH
UCI Programming Manual FlexRay, V1.13
External interfaces
17
Example:
// definition of function pointer to UCI_CreateInstance
typedef HRESULT (WINAPI *PF_UCICREATE )( UINT32
, PCHAR
, LPUCIBOARD* );
XAT_BoardCFG sConfig;
DWORD dwTmp;
HRESULT hr = S_OK;
HMODULE hUci = 0;
PF_UCICREATE pfUciCreate = 0;
LPUCIBOARD pBoard = 0;
char szUCIDLL[32] = {0};
// open select hardware dialog
hr = XAT_SelectHardware( hwndParent
, &sConfig );
if ( 1 == hr )
{
// get name of UCI DLL for this board
hr = XAT_GetHwEntryVar( sConfig.board_no
, "UCI_DLL"
, szUCIDLL
, &dwTmp );
if ( S_OK == hr )
{
// load UCI library
hUci = LoadLibrary( szUCIDLL );
if ( NULL != hUci )
{
// get pointer to UCI_CreateInstance
pfUciCreate = (PF_UCICREATE)GetProcAddress( hUci
, "UCI_CreateInstance"
);
if ( NULL != pfUciCreate )
{
// create UCI instance
hr = pfUciCreate( sConfig.board_no
, sConfig.sz_CardAddString
, &pBoard );
if ( UCI_OK == hr )
{
// open FlexRay controller and proceed FlexRay communication
...
pBoard->Release();
pBoard = NULL;
}
}
}
}
}
Содержание FlexRay CCM
Страница 6: ......