op_ev_type()
Abstract
Obtains the type of the event.
Syntax
op_ev_type (evhandle)
| Argument | Type | Description |
|---|---|---|
evhandle |
Evhandle |
event handle that identifies the event [An event handle can be obtained from several KPs in this package—such as op_ev_current(), op_ev_seek_time(), and op_ev_next()—and others such as op_intrpt_schedule_self().]. |
Return Type
int
Type of the specified event (also referred to as the interrupt type).
This is an integer numeric code representing one of the possible event types (see Table 59 “Interrupt Type Symbolic Constants“ on page 15). The constant OPC_INTRPT_INVALID is returned if a recoverable error occurs.
Example
/* Obtain the currently executing event (it must be at this module, */
/* since this module woke up.) and the one after it. */
this_event = op_ev_current ();
next_event = op_ev_next_local (this_event);
/* Loop through all of the events scheduled for this module */
/* and cancel any that are retransmission timers. */
while (op_ev_valid (next_event))
{
if ((op_ev_type (next_event) == OPC_INTRPT_SELF) &&
(op_ev_code (next_event) == RETRANS_TIMER))
{
retrans_timer = next_event;
next_event = op_ev_next_local (retrans_timer);
op_ev_cancel (retrans_timer);
}
else
/* Obtain the next event; if there are no more events, op_ev_next_local () */
/* will return an invalid event handle and the loop will terminate. */
next_event = op_ev_next_local (next_event);
}
Details
This KP returns a numeric value that can be compared to one of the interrupt type symbolic constants listed below:
OPC_INTRPT_ACCESS—access interruptOPC_INTRPT_BEGSIM—begin simulation interruptOPC_INTRPT_ENDSIM—end simulation interruptOPC_INTRPT_ESYS_INTERFACE—external system interruptOPC_INTRPT_ESYS_INTERFACE_EXT—external system interrupt (from cosimulator)OPC_INTRPT_FAIL—node/link failure interruptOPC_INTRPT_MCAST—multicast interruptOPC_INTRPT_PROCEDURE—procedure interruptOPC_INTRPT_PROCESS—process interruptOPC_INTRPT_RECOVER—node/link recovery interruptOPC_INTRPT_REGULAR—regular interruptOPC_INTRPT_REMOTE—remote interrupt)OPC_INTRPT_REMOTE_END_RCV—end of packet arrival at receiverOPC_INTRPT_REMOTE_START_RCV—beginning of packet arrival at receiverOPC_INTRPT_REMOTE_START_XMT—beginning of packet transmission at transmitter the “split_start_radio_transmission“ preference is TRUEOPC_INTRPT_SELF—self interruptOPC_INTRPT_SELF_END_XMT—end of packet transmission at transmitterOPC_INTRPT_STAT—statistic interruptOPC_INTRPT_STRM—stream interrupt
Purpose
Provides a mechanism to determine what type of event an Evhandle refers to.
Errors
- Program Abort: Segmentation violation. (due to a malformed event handle)
- Recoverable Error: Event handle refers to an event that is either invalid or not currently scheduled.
Reference
- Use the KP op_ev_valid() to determine if the Evhandle is valid
- Use the KP op_ev_code() to determine the code of a self, remote, or multicast interrupt
- Use the KP op_ev_strm() to determine the stream index associated with a stream interrupt
- Use the KP op_ev_stat() to determine the input statistic index associated with a statistic interrupt
- Use the KP op_ev_time() to determine the scheduled time of the event
- Use the KP op_ev_ici() to obtain the ICI associated with the event