op_td_increment_dbl()
Abstract
Increments a TDA double value by a specified amount.
Syntax
op_td_increment_dbl (pkptr, tda_index, value)
| Argument | Type | Description |
|---|---|---|
pkptr |
Packet* |
pointer to the packet-of-interest |
tda_index |
int |
numeric index of the transmission data attribute-of-interest. The TDA must be a double. [This value is an integer code that specifies the transmission data attribute to be accessed. Predefined values for this argument appear in “Transmission Data Attribute“ on page 28. User-defined transmission information can be obtained from any attribute index greater than the largest index occupied by a predefined attribute (assuming the attribute has been previously assigned). The largest predefined attribute indices are OPC_TDA_PT_MAX_INDEX (for the point-to-point pipeline), OPC_TDA_BU_MAX_INDEX (for the bus pipeline), and OPC_TDA_RA_MAX_INDEX (for the radio pipeline).] |
value |
double |
value to be added to the current TDA value |
Return Type
void
no return value
Example
/* Determine if arriving packet is valid or noise. */
arriv_match = op_td_get_int (pkptr_arriv, OPC_TDA_RA_MATCH_STATUS);
/* Get received power levels for both packets. */
prev_rcvd_power = op_td_get_dbl (pkptr_prev, OPC_TDA_RA_RCVD_POWER);
arriv_rcvd_power = op_td_get_dbl (pkptr_arriv, OPC_TDA_RA_RCVD_POWER);
/* If the arriving packet is valid, calculate */
/* interference of previous packet on arriving one. */
if (arriv_match == OPC_TDA_RA_MATCH_VALID)
{
op_td_increment_dbl (pkptr_arrive, OPC_TDA_RA_NOISE_ACCUM, prev_rcvd_power);
}
Details
This function adds the value argument to the current TDA value. If the TDA does not exist, this function creates a new custom TDA with an initial value of value.
Purpose
When changing a TDA value, this function provides a convenient alternative to using op_td_get_dbl() and op_td_set_dbl().
Errors
- Recoverable Error:
<type>TDA (<name>) cannot be incremented using 'op_td_increment_dbl'. - Program Abort: Segmentation violation. (due to an invalid packet pointer or malformed packet)
- Program Abort: Packet pointer is NIL.
- Program Abort: Packet pointer references destroyed packet (
<pk_id>). - Program Abort: Tda index (
<tda_index>) is out-of-range for packet (<pk_id>). - Program Abort: Read-only Tda (
<tda_name>) cannot be modified in pk (<pk_id>)
Reference
- Use the KP op_td_increment_int() or op_td_increment_int64() to increment the value of an integer transmission data attribute
- Use the KP op_td_get_dbl() to obtain the value of a double transmission data attribute
- Use the KP op_td_set_dbl() to assign the value of a double transmission data attribute
- Use the KP op_td_is_set() to determine whether a transmission data attribute has been assigned