⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 trglib.html

📁 Vxworks API操作系统和驱动程序设计API。压缩的HTML文件
💻 HTML
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/trgLib.html - generated by refgen from trgLib.c --> <title> trgLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.htm"><i>VxWorks API Reference :  OS Libraries</i></a></p></blockquote><h1>trgLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>trgLib</strong> - trigger events control library  </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./trgLib.html#trgLibInit">trgLibInit</a>(&nbsp;)</b>  -  initialize the triggering library<br><b><a href="./trgLib.html#trgWorkQReset">trgWorkQReset</a>(&nbsp;)</b>  -  Resets the trigger work queue task and queue<br><b><a href="./trgLib.html#trgAdd">trgAdd</a>(&nbsp;)</b>  -  add a new trigger to the trigger list<br><b><a href="./trgLib.html#trgDelete">trgDelete</a>(&nbsp;)</b>  -  delete a trigger from the trigger list<br><b><a href="./trgLib.html#trgOn">trgOn</a>(&nbsp;)</b>  -  set triggering on<br><b><a href="./trgLib.html#trgOff">trgOff</a>(&nbsp;)</b>  -  set triggering off<br><b><a href="./trgLib.html#trgEnable">trgEnable</a>(&nbsp;)</b>  -  enable a trigger<br><b><a href="./trgLib.html#trgDisable">trgDisable</a>(&nbsp;)</b>  -  turn a trigger off<br><b><a href="./trgLib.html#trgChainSet">trgChainSet</a>(&nbsp;)</b>  -  chains two triggers<br><b><a href="./trgLib.html#trgEvent">trgEvent</a>(&nbsp;)</b>  -  trigger a user-defined event <br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p><p>This library provides the interface for triggering events.  The routinesprovide tools for creating, deleting, and controlling triggers.  However,in most cases it is preferable to use the GUI to create and managetriggers, since all order and dependency factors are automaticallyaccounted for there.<p>The event types are defined as in WindView. Triggering and WindView sharethe same instrumentation points. Furthermore, one of the main uses oftriggering is to start and stop WindView instrumentation.  Triggering isstarted by the routine <b><a href="./trgLib.html#trgOn">trgOn</a>(&nbsp;)</b>, which sets the shared variable <b>evtAction</b>.Once the variable is set, when an instrumented point is hit, <b>trgCheck(&nbsp;)</b> iscalled. The routine looks for triggers that apply to this event.  Theroutine <b><a href="./trgLib.html#trgOff">trgOff</a>(&nbsp;)</b> stops triggering.  The routine <b><a href="./trgLib.html#trgEnable">trgEnable</a>(&nbsp;)</b> enables aspecific trigger that was previously disabled with <b><a href="./trgLib.html#trgDisable">trgDisable</a>(&nbsp;)</b>. (Atcreation time all triggers are enabled by default.) This routine alsochecks the number of triggers currently enabled, and when this is zero, itturns triggering off.<p></blockquote><h4>NOTE</h4><blockquote><p>It is important to create a trigger before calling <b><a href="./trgLib.html#trgOn">trgOn</a>(&nbsp;)</b>. <b><a href="./trgLib.html#trgOn">trgOn</a>(&nbsp;)</b>checks the trigger list to see if there is at least one trigger there, and ifnot, it exits without setting <b>evtAction</b>.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>trgLibP.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><p><i>WindView User's Guide </i><hr><a name="trgLibInit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>trgLibInit(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>trgLibInit(&nbsp;)</strong> - initialize the triggering library</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS trgLibInit (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes the trigger class. Triggers are VxWorks objects and therefore require a class to be initialized.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./trgLib.html#top">trgLib</a></b><hr><a name="trgWorkQReset"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>trgWorkQReset(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>trgWorkQReset(&nbsp;)</strong> - Resets the trigger work queue task and queue</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS trgWorkQReset (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>When a trigger fires, if the assocated action requires a function to be calledin "safe" mode, a pointer to the required function will be placed on a queueknown as the "triggering work queue". A system task "tActDef" is spawned toaction these requests at task level. Should the user have need to reset thiswork queue (e.g. if a called task causes an exception which causes thetrgActDef task to be SUSPENDED, or if the queue gets out of sync and becomesunresponsive), <b><a href="./trgLib.html#trgWorkQReset">trgWorkQReset</a>(&nbsp;)</b> may be called.<p>Its effect is to delete the trigger work queue task and its associated resources and then recreate them. Any entries pending on the triggering workqueue will be lost. Calling this function with triggering on will result intriggering being turned off before the queue reset takes place. It is theresponsibility of the user to turn triggering back on.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the triggering task and its associated resourcescannot be deleted and recreated.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./trgLib.html#top">trgLib</a></b><hr><a name="trgAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>trgAdd(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>trgAdd(&nbsp;)</strong> - add a new trigger to the trigger list</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>TRIGGER_ID trgAdd    (    event_t   event,    int       status,    int       contextType,    UINT32    contextId,    OBJ_ID    objId,    int       conditional,    int       condType,    int *     condEx1,    int       condOp,    int       condEx2,    BOOL      disable,    TRIGGER * chain,    int       actionType,    FUNCPTR   actionFunc,    BOOL      actionDef,    int       actionArg    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine creates a new trigger and adds it to the proper trigger list.  Ittakes the following parameters:<dl><dt><i>event</i><dd>as defined in <b>eventP.h</b> for WindView, if given.<dt><i>status</i><dd>the initial status of the trigger (enabled or disabled).<dt><i>contextType</i><dd>the type of context where the event occurs.<dt><i>contextId</i><dd>the ID (if any) of the context where the event occurs.<dt><i>objectId</i><dd>if given and applicable.<dt><i>conditional</i><dd>the indicator that there is a condition on the trigger.<dt><i>condType</i><dd>the indicator that the condition is either a variable or a function.<dt><i>condEx1</i><dd>the first element in the comparison.<dt><i>condOp</i><dd>the type of operator (==, !=, <, <=, >, >=, |, &).<dt><i>condEx2</i><dd>the second element in the comparison (a constant).<dt><i>disable</i><dd>the indicator of whether the trigger must be disabled once it is hit.<dt><i>chain</i><dd>a pointer to another trigger associated to this one (if any).<dt><i>actionType</i><dd>the type of action associated with the trigger (none, func, lib).<dt><i>actionFunc</i><dd>the action associated with the trigger (the function).<dt><i>actionDef</i><dd>the indicator of whether the action can be deferred (deferred is the default).<dt><i>actionArg</i><dd>the argument passed to the function, if any.</dl><p>Attempting to call trgAdd whilst triggering is enabled is not allowedand will return NULL.<p></blockquote><h4>RETURNS</h4><blockquote><p><b>TRIGGER_ID</b>, or NULL if either the trigger ID can not be allocated,or if called whilst triggering is enabled.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./trgLib.html#top">trgLib</a></b>, <b><a href="./trgLib.html#trgDelete">trgDelete</a>(&nbsp;)</b><hr><a name="trgDelete"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>trgDelete(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>trgDelete(&nbsp;)</strong> - delete a trigger from the trigger list</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS trgDelete    (    TRIGGER_ID trgId    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deletes a trigger by removing it from the trigger list.  Italso checks that no other triggers are still active.  If there are noactive triggers and triggering is still on, it turns triggering off.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the trigger is not found.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./trgLib.html#top">trgLib</a></b>, <b><a href="./trgLib.html#trgAdd">trgAdd</a>(&nbsp;)</b><hr><a name="trgOn"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>trgOn(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>trgOn(&nbsp;)</strong> - set triggering on</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS trgOn (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine activates triggering.  From this time on, any time an eventpoint is hit, a check for the presence of possible triggers is performed.Start triggering only when needed since some overhead is introduced.<p></blockquote><h4>NOTE</h4><blockquote><p>If <b><a href="./trgLib.html#trgOn">trgOn</a>(&nbsp;)</b> is called when there are no triggers in the trigger list, itimmediately sets triggering off again.  If <b><a href="./trgLib.html#trgOn">trgOn</a>(&nbsp;)</b> is called with at leastone trigger in the list, triggering begins.  Triggers should not be added to the list while triggering is on since this can createinstability.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./trgLib.html#top">trgLib</a></b>, <b><a href="./trgLib.html#trgOff">trgOff</a>(&nbsp;)</b><hr><a name="trgOff"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>trgOff(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>trgOff(&nbsp;)</strong> - set triggering off</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void trgOff (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine turns triggering off. From this time on, when an event point is hit, no search on triggers is performed.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./trgLib.html#top">trgLib</a></b>, <b><a href="./trgLib.html#trgOn">trgOn</a>(&nbsp;)</b><hr><a name="trgEnable"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>trgEnable(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>trgEnable(&nbsp;)</strong> - enable a trigger</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS trgEnable    (    TRIGGER_ID trgId    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine enables a trigger that has been created with <b><a href="./trgLib.html#trgAdd">trgAdd</a>(&nbsp;)</b>. A counteris incremented to keep track of the total number of enabled triggers so that <b><a href="./trgLib.html#trgDisable">trgDisable</a>(&nbsp;)</b> knows when to set triggering off. If the maximum number of enabled triggers is reached, an error is returned. <p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the trigger ID is not found or if the maximumnumber of triggers has already been enabled.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./trgLib.html#top">trgLib</a></b>, <b><a href="./trgLib.html#trgDisable">trgDisable</a>(&nbsp;)</b><hr><a name="trgDisable"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>trgDisable(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>trgDisable(&nbsp;)</strong> - turn a trigger off</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS trgDisable    (    TRIGGER_ID trgId    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine disables a trigger. It also checks to see if there are triggersstill active.  If this is the last active trigger it sets triggering off.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the trigger ID is not found.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./trgLib.html#top">trgLib</a></b>, <b><a href="./trgLib.html#trgEnable">trgEnable</a>(&nbsp;)</b><hr><a name="trgChainSet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>trgChainSet(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>trgChainSet(&nbsp;)</strong> - chains two triggers</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS trgChainSet    (    TRIGGER_ID fromId,    TRIGGER_ID toId    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine chains two triggers together.  When the first trigger fires, itcalls <b><a href="./trgLib.html#trgEnable">trgEnable</a>(&nbsp;)</b> for the second trigger.  The second trigger must be createddisabled in order to maintain the correct sequence.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./trgLib.html#top">trgLib</a></b>, <b><a href="./trgLib.html#trgEnable">trgEnable</a>(&nbsp;)</b><hr><a name="trgEvent"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>trgEvent(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>trgEvent(&nbsp;)</strong> - trigger a user-defined event </p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void trgEvent    (    event_t evtId             /* event */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine triggers a user event. A trigger must exist and triggering must have been started with <b><a href="./trgLib.html#trgOn">trgOn</a>(&nbsp;)</b> or from the triggering GUI to use this routine.  The <i>evtId</i> should be in the range 40000-65535. <p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./trgLib.html#top">trgLib</a></b>, <b><a href="./dbgLib.html#top">dbgLib</a></b>, <b><a href="./dbgLib.html#e">e</a>(&nbsp;)</b><p>INTERNAL</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -