VxWorks Reference Manual : Libraries
wdbUserEvtLib - WDB user event library
wdbUserEvtLibInit( ) - include the WDB user event library
wdbUserEvtPost( ) - post a user event string to host tools.
This library contains routines for sending WDB User Events. The event is sent through the WDB agent, the WDB communication link and the target server to the host tools that have registered for it. The event received by host tools will be a WTX user event string.
wdb/wdbLib.h
wdbUserEvtLib, API Guide: WTX Protocol
wdbUserEvtLibInit( ) - include the WDB user event library
void wdbUserEvtLibInit (void)
This null routine is provided so that wdbUserEvtLib can be linked into the system. If INCLUDE_WDB_USER_EVENT is defined in configAll.h, wdbUserEvtLibInit is called by the WDB config routine, wdbConfig( ), in usrWdb.c.
N/A
wdbUserEvtPost( ) - post a user event string to host tools.
STATUS wdbUserEvtPost ( char * event /* event string to send */ )
This routine posts the string event to host tools that have registered for it. Host tools will receive a USER WTX event string. The maximum size of the event is WDB_MAX_USER_EVT_SIZE (defined in $WIND_BASE/target/h/wdb/wdbLib.h).
The code below sends a WDB user event to host tools :
char * message = "Alarm: reactor overheating !!!"; if (wdbUserEvtPost (message) != OK) printf ("Can't send alarm message to host tools");This event will be received by host tools that have registered for it. For example a WTX TCL based tool would do :
wtxtcl> wtxToolAttach EP960CX EP960CX_ps@sevre wtxtcl> wtxRegisterForEvent "USER.*" 0 wtxtcl> wtxEventGet USER Alarm: reactor overheating !!!Host tools can register for more specific user events :
wtxtcl> wtxToolAttach EP960CX EP960CX_ps@sevre wtxtcl> wtxRegisterForEvent "USER Alarm.*" 0 wtxtcl> wtxEventGet USER Alarm: reactor overheating !!!In this piece of code, only the USER events beginning with "Alarm" will be received.
OK upon successful completion, a WDB error code if unable to send the event to the host or ERROR if the size of the event is greater than WDB_MAX_USER_EVT_SIZE.