VxWorks Reference Manual : Libraries

wdbUserEvtLib

NAME

wdbUserEvtLib - WDB user event library

ROUTINES

wdbUserEvtLibInit( ) - include the WDB user event library
wdbUserEvtPost( ) - post a user event string to host tools.

DESCRIPTION

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.

INCLUDE FILES

wdb/wdbLib.h

SEE ALSO

wdbUserEvtLib, API Guide: WTX Protocol


Libraries : Routines

wdbUserEvtLibInit( )

NAME

wdbUserEvtLibInit( ) - include the WDB user event library

SYNOPSIS


void wdbUserEvtLibInit (void)

DESCRIPTION

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.

RETURNS

N/A

SEE ALSO

wdbUserEvtLib


Libraries : Routines

wdbUserEvtPost( )

NAME

wdbUserEvtPost( ) - post a user event string to host tools.

SYNOPSIS

STATUS wdbUserEvtPost
    (
    char * event /* event string to send */
    )

DESCRIPTION

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).

EXAMPLE

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.

RETURNS

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.

SEE ALSO

wdbUserEvtLib