User manual

96
}
}
The example above 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.4 Committing last change of configuration option value
Committing option value 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. Option value changed
in configuration file has to be committed in order to update value in loadable component
configuration option buffer.
To perform the operation, the initiator invokes a routine identified by the
commit_option_value field of the chapi_in descriptor. The initiator provides in the opt_name
parameter the name of configuration option to commit value of and in the opt_val_idx the
index of option value to commit (from 0 to opt_vals_count - 1). The procedure is invoked as
follows assuming that described in the previous chapter options are added during the
loadable module initialization:
// Define option storage somewhere in loadable component implementation
int my_int_opt;
bool my_bool_opt[3];
char my_str_opt[256];
const chapi_in * ci = …;
if (ci->commit_option_value) {
// Commit last changes in bool_opt values in order to
// update our configuration buffers
for(int idx = 0; idx < 3; idx++) {
ci->commit_option_value(ci, “bool_opt”, idx);
}
}
The example above 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.5 Checking if configuration option value is specified
Checking if configuration option value is specified 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 is commonly used in order to check before the device start if all
required option values are specified and set default values if not.
To perform the operation, the initiator invokes a routine identified by the
is_option_value_specified field of the chapi_in descriptor. The initiator provides in the