op_ici_attr_get_dbl()
Abstract
Obtains the value of a double attribute in the specified ICI.
Syntax
op_ici_attr_get_dbl (iciptr, attr_name, value_ptr)
| Argument | Type | Description |
|---|---|---|
iciptr |
Ici * |
pointer to the ICI-of-interest [A pointer to an ICI can be obtained from two KPs: op_ici_create() returns a pointer to a newly allocated ICI (in an ICI-sending process), and op_intrpt_ici() returns a pointer to an ICI associated with an incoming interrupt (in an ICI-receiving process).] |
attr_name |
const char * |
name of the attribute-of-interest |
value_ptr |
double * |
pointer to a variable to be filled in with the specified attribute’s value |
Return Type
Compcode
OPC_COMPCODE_SUCCESS if the attribute value was successfully obtained; OPC_COMPCODE_FAILURE otherwise.
Example
dbl AAL2_Peak_Cell_Rate;
/* Copy the contents of the ICI into the created data structure. */
op_ici_attr_get_dbl (aal_params_iciptr, "max bit rate",
&(aal_params_struct_ptr->AAL2_Peak_Cell_Rate));
Details
The specified attribute name must be one of the attributes defined in the ICI format that is the basis of the ICI pointed to by the iciptr argument. Note that the value obtained by this KP is the current contents of the specified attribute in the ICI; it is not the contents of the attribute when the ICI was installed nor when the associated interrupt was scheduled.
Process models manipulate ICIs via their pointers and, unlike packets, there is no notion of ownership for an ICI. This means that several process models might concurrently have legitimate access to the same ICI data structure and interfere with each others’ use of the attributes. Another common problem occurs when the same ICI is used in association with multiple events. It is important to realize that while an ICI can be associated with multiple events, modifications to the ICI that are made in preparation for the later events might also affect the use of that ICI during earlier events, if these have not yet occurred at the time of the modification. For instance, if a process creates an ICI, assigns its attributes, installs it, sends out a packet, and then modifies an attribute of the ICI before the packet is received, the modified value will be the one provided when the process model receiving the packet accesses the ICI via this KP.
Purpose
Provides a mechanism for a process that has received an interrupt with an associated ICI to determine the values of the ICI’s double attributes. This capability forms the “receive” side of ICI-based communications between processes. Note also that, because a single ICI can be shared by multiple processes, it can be used for multi-way communication where a process that receives an interrupt obtains certain control information from the ICI, but also returns information by setting attributes in the same ICI. This is a particularly useful technique when used in combination with forced interrupts, since the return value can be accessed immediately by the originating process.
Errors
- Program Abort: Segmentation violation (due to an invalid ICI pointer, malformed ICI data structure, or incorrectly declared
value_ptrargument). - Recoverable Error: Attribute name (
<attr_name>) is unrecognized in ICI with format (<format_name>).
Reference
- Use the KP op_intrpt_ici() to obtain the ICI pointer associated with an incoming interrupt
- Use the KP op_ici_attr_get_int32() to obtain the value of a 32-bit integer attribute in a specified ICI
- Use the KP op_ici_attr_get_int64() to obtain the value of a 64-bit integer attribute in a specified ICI
- Use the KP op_ici_attr_get_ptr() to obtain the value of a pointer attribute in a specified ICI