User manual

101
// Disable all option values for the “bool_opt”
for(int idx = 0; idx < 3; idx++) {
ci->disable_option_value(ci, “bool_opt”, idx);
}
}
The example shows that the CHARON core is not obliged to support the indicated
operation. It indicates why the device instance must remember the chapi_in descriptor.
4.19.12 Chacking if option value is hidden
Checking if configuration option value is hiodden belongs to the “A request to process
loadable component defined configuration options” class of operations. Such an operation
is initiated by the device instance. The CHARON core is defined as a target of the
operation. This operation checks if specified value of specified configuration option is
hidden from external entities or not.
To perform the operation, the initiator invokes a routine identified by the
is_option_value_hidden field of the chapi_in descriptor. The initiator provides in the opt_name
parameter the name of configuration option to check access level for and in the opt_val_idx
parameter the index of option value to check access level for (from 0 to opt_vals_count - 1).
Invocation example is below:
// Define option storage somewhere in loadable component implementation
int my_int_opt;
bool my_bool_opt[3];
const chapi_in * ci = …;
if (ci->is_option_value_hidden && ci->enable_option_value) {
// Enable option values if they are hidden
for(int idx = 0; idx < 3; idx++) {
if(ci->is_option_value_hidden(ci, “bool_opt”, idx)) {
ci->enable_option_value(ci, “bool_opt”, idx, true);
}
}
}
The example shows that the CHARON core is not obliged to support the indicated
operation. It indicates why the device instance must remember the chapi_in descriptor.
4.20 Changing the configuration
There are two different ways to change configuration for the CHAPI device the old one
based on a single predefined configuration option parameters and the new way based on