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

📄 x-trigapi2.html

📁 vxworks相关论文
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title>    Triggering API   </title></head><body bgcolor="FFFFFF"><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="x-trigAPI.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="x-trigAPI.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="x-trigAPI1.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="x-trigAPI3.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p><font face="Helvetica, sans-serif" class="sans"><h3 class="H2"><i><a name="83710">E.2  &nbsp;&nbsp;Trigger Structure</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="87067"> </a>The host tools allow users to enter specific information and commands, which the tools then download to the target. Data is usually entered in the GUI window, but it can be entered at the command line as well. The GUI displays and allows entering of the following information (see <a href="x-trigAPI2.html#89735">Figure&nbsp;E-2</a>):</p></dl><dl class="margin"><p class="listspace"><ul class="Bullet" type="disc"><li><a name="88773"> </a>Show trigger information. </li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="88780"> </a>Activate triggering. </li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="88781"> </a>Create and delete triggers. </li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="88782"> </a>Enable and disable triggers. </li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="87071"> </a>Choose the event, context, and/or object which will activate a trigger. </li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="87088"> </a>Define a conditional expression to refine the circumstances which will activate the trigger (optional). </li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="87090"> </a>Define the actions related to the trigger (optional) such as: </li></ul></p><dl class="margin"><p class="listspace"><ul class="Dash2" type="circle"><li><a name="87092"> </a>call a user function (the function parameters must be given) </li></ul></p><p class="listspace"><ul class="Dash2" type="circle"><li><a name="87098"> </a>start or stop logging </li></ul></p></dl><p class="listspace"><ul class="Bullet" type="disc"><li><a name="88735"> </a>Provide the ID of another trigger to be chained to the current one (optional).&nbsp;&nbsp;<div class="frame"><h4 class="EntityTitle"><a name="89735"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure E-2:&nbsp;&nbsp;Triggering Window and Trigger Maintenance Dialog Box </font></a></h4><dl class="margin"><div class="Anchor"><a name="89786"> </a><img class="figure" border="0" src="images/x-trigAPIa1.gif"></div></dl></div> </li></ul></p></dl><dl class="margin"><dd><p class="Body"><a name="87149"> </a>Once it receives this information, the target is responsible for triggering and performs the following actions: </p></dl><dl class="margin"><p class="listspace"><ul class="Bullet" type="disc"><li><a name="87114"> </a>Organizes the data received from the host in a trigger list. </li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="87115"> </a>Manages the trigger list. </li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="87116"> </a>Activates and deactivates event triggering. </li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="87117"> </a>Performs the actions requested by the host (such as disabling, enabling, or deleting triggers). </li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="87119"> </a>Interacts with WindView and the event points. </li></ul></p></dl><dl class="margin"><dd><p class="Body"><a name="83711"> </a>The target saves the information coming from the host in a trigger structure. The target is also responsible for setting the flag to activate triggering when necessary. When this flag is set, the event can be detected by the regular WindView instrumentation, by <b class="routine"><i class="routine">e</i></b><b>(&nbsp;)</b>, or through <b class="routine"><i class="routine">trgEvent</i></b><b>(&nbsp;)</b>. Once the event occurs, the <b class="symbol_UC">ACTION_IS_SET</b><b class="symbol_lc"> </b>variable is checked to see whether WindView or triggering is active. </p><dd><p class="Body"><a name="83727"> </a>If triggering is active, the list of triggers is checked to see if any is related to that event. If one is found, the specified action is performed. Otherwise execution continues. </p><dd><p class="Body"><a name="83730"> </a>The triggering structure is defined as follows:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84393">typedef struct trigger     {     OBJ_CORE &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;objCore; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* trigger object core */     event_t &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eventId; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* event type */     UINT16 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;status; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* status of the trigger, */                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* i.e. enabled, disabled, etc */     BOOL &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;disable; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* check if trigger needs to be */                                      &nbsp;&nbsp;/* disabled after use */     int &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;contextType; &nbsp;&nbsp;/* type of context where */                                     &nbsp;&nbsp;/* event occurs */     UINT32 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;contextId; &nbsp;&nbsp;&nbsp;&nbsp;/* id of context where */                                     &nbsp;&nbsp;/* event occurs */     OBJ_ID &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;objId; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* object type */     struct trigger &nbsp;&nbsp;&nbsp;*chain; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* pointer to chained trigger */     struct trigger &nbsp;&nbsp;&nbsp;*next; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* ptr to next trigger in list */     int &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;conditional; &nbsp;&nbsp;/* check if a condition is set */     int &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;condType; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* check the expression */                                     &nbsp;&nbsp;/* type (var/fn) */     void * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;condEx1; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* ptr to conditional expression */     int &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;condOp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* conditional operator */                                     &nbsp;&nbsp;*/ (==, !=, ...) */     int &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;condEx2; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* second operand (constant) */     int &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actionType; &nbsp;&nbsp;&nbsp;/* type of action (none, fn, lib) */     FUNCPTR &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actionFunc; &nbsp;&nbsp;&nbsp;/* pointer to the action */     int &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actionArg; &nbsp;&nbsp;&nbsp;&nbsp;/* argument passed to the action */     BOOL &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actionDef; &nbsp;&nbsp;&nbsp;&nbsp;/* defer the action */     } TRIGGER;</a></b></pre></dl><dd><p class="Body"><a name="88830"> </a>The following macros are also defined:</p></dl><dl class="margin"><p class="listspace"><ul class="Dash" type="circle"><li><a name="84548"> </a>Representing the status of the trigger: </li></ul></p><dl class="margin"><dl class="margin"><dd><pre class="Code3"><b><a name="84463">#define TRG_ENABLE 1 #define TRG_DISABLE 0</a></b></pre></dl></dl><p class="listspace"><ul class="Dash" type="circle"><li><a name="84805"> </a>Defining whether the condition is a variable or a function: </li></ul></p><dl class="margin"><dl class="margin"><dd><pre class="Code3"><b><a name="84478">#define TRIGGER_COND_FUNC       0 #define TRIGGER_COND_VAR        1 #define TRIGGER_COND_LIB        2</a></b></pre></dl></dl></dl></dl><a name="foot"><hr></a><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="x-trigAPI.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="x-trigAPI.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="x-trigAPI1.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="x-trigAPI3.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p></body></html><!---by WRS Documentation (), Wind River Systems, Inc.    conversion tool:  Quadralay WebWorks Publisher 4.0.11    template:         CSS Template, Jan 1998 - Jefro --->

⌨️ 快捷键说明

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