6.1. console — System console

The system console is the default communication channel to an application. The console input and output channels are often terminated by a shell to enable the user to control and debug the application.

Configure the console by changing the configuration variables called CONFIG_START_CONSOLE*.


Source code: src/oam/console.h, src/oam/console.c

Test coverage: src/oam/console.c


Functions

int console_module_init(void)

Initialize the console module. This function must be called before calling any other function in this module.

The module will only be initialized once even if this function is called multiple times.

Return
zero(0) or negative error code.

int console_init(void)

Initialize the console.

Return
zero(0) or negative error code.

int console_start(void)

Start the console.

Return
zero(0) or negative error code.

int console_stop(void)

Stop the console.

Return
zero(0) or negative error code.

int console_set_input_channel(void *chan_p)

Set the pointer to the input channel.

Return
zero(0) or negative error code.

void *console_get_input_channel(void)

Get the pointer to the input channel.

Return
Input channel or NULL.

void *console_set_output_channel(void *chan_p)

Set the pointer to the output channel.

Return
zero(0) or negative error code.

void *console_get_output_channel(void)

Get the pointer to the output channel.

Return
Output channel or NULL.