setIntValue
Sets the int value of the configuration, and assigns the configuration (the node ID, the number of fractional bits, and number of enabled threads) to config through setIntValue, and then registers config with the KCAL instance.
int setIntValue (
DG_Cfg config,
const char *key,
int value
)
Parameters
Parameter |
Description |
Value Range |
Input/Output |
|---|---|---|---|
config |
Initialized configuration. |
Key and value. |
Output |
key |
A unique identifier for the value, used when setting the node ID. |
Key values:
|
Input |
value |
Value in the int type. |
The value is set based on the key. |
Input |
Return Values
- Success: 0 is returned.
- Failure: The error code is returned.
Error Codes
Error Code |
Value |
Description |
Remarks |
|---|---|---|---|
DG_ERR_CONFIG_PARAM |
62 |
Failed to verify the parameters. |
config or key is null. |
Dependency
#include "data_guard_config.h": the header file where the API declaration is stored.
Example
#include "data_guard_config.h" // opts is the result of the successful DG_InitConfigOpts call. int nodeId = 0; //This is the node ID of compute node 0. For compute node 1, the value is set to 1. int res = opts->setIntValue(teeCfg, DG_CON_MPC_TEE_INT_NODEID, nodeId);
Running result: res is 0.
- Call the setIntValue API using the opts output of the successful DG_InitConfigOpts call.
- Set the node ID of each node.
Parent topic: DataGuard APIs for Configuring an Operation Set