Getting started
Copyright IXXAT Automation GmbH
39
IEM Manual, 1.5
2.3.11.1.6 Registering events
Any event that shall be observed has to be registered by the
APP_EventRegisterSpecific() and APPdemo_EventRegisterGeneric() function
from the application demo.
...
/* Register generic events */
e_ret = APPdemo_EventRegisterGeneric();
if (e_ret != COM_k_OK)
{
DBG_PRINTF(("Error %d in APP_EventRegisterGeneric\n", e_ret));
return e_ret;
}
/* Register all protocol specific events */
e_ret = APP_EventRegisterSpecific(APP_dw_Protocol);
if (e_ret != COM_k_OK)
{
DBG_PRINTF(("Error %d in APP_EventRegisterSpecific\n", e_ret));
return e_ret;
}
...
Figure 2-17: Register events I
The following code snippet shows how an event is being registered.
// register callback for online event
e_ret = EMI_evtEventRegister(APP_d_BrdRef,(UINT32)
COM_k_EVT_ONLINE
,
APPdemo_OnlineEventClbk, TRUE);
if (e_ret !=
COM_k_OK
)
{
DBG_PRINTF(("'%s(%d)' -> Error %d in EMI_evtEventRegister\n",
__FILE__, __LINE__, e_ret));
return e_ret;
}
Figure 2-18: Register events II
The associated callback function has to be coded according the prototype.
/** COM_t_CBK:
Event callback function
*/
typedef void (*COM_t_CBK)(UINT32 dw_event, UINT32 dw_param);
Figure 2-19: Event callback