User manual
103
that one of its configuration options are changed and should be processed somehow (see
4.19.2 for examples). The procedure is invoked as follows:
const chapi_out * co = …;
if (co->set_configuration_ex) {
co->set_configuration_ex(co);
}
The example above shows that the device is not obliged to support the indicated
operation.
4.21 Message logging
The legacy way to log messages has been preserved for compatibility reasons. The new
method has two options to handle debug trace and messaging.
4.21.1 The legacy way of message logging
Message logging belongs to the class of operations called “Message log request”.
CHARON enables the component that logs messages in the emulator’s log file. Both the
CHARON core and the loadable component may initiate such an operation, but only the
emulator can be a target.
To perform the operation, the initiator invokes a routine identified by the log_message field
of the chapi_in descriptor. The initiator provides a formatted message in a buffer, pointed
to by the buf argument, of a length (in bytes) as indicated by the len argument. The
procedure is invoked as follows:
const chapi_in * ci = …;
if (ci->log_message) {
ci->log_message(ci, buf, len);
}
The example above shows that the CHARON core is not obliged to support the indicated
operation. It also shows why the loadable component instance must remember the
chapi_in descriptor.
4.21.2 The recommended way for message logging
Message logging belongs to the class of operations called “Message log request”.
CHARON enables the component that logs messages in the emulator’s log file. Both the
CHARON core and the loadable component may initiate such an operation, but only the
emulator can be a target.
To perform the operation, the initiator invokes a routine identified by the log_message_ex
field of the chapi_in descriptor. The initiator provides in the log_msg_type parameter the type
of message to log (error_msg_type, warning_msg_type and info_msg_type can be used here),
in the file parameter the name of the file where the message is coming from (__FILE__










