Jump to main content

##

# 1.2.4.4.13 SYS_CONSOLE_Print Function

## C

    void SYS_CONSOLE_Print(const SYS_CONSOLE_HANDLE handle, const char *format, ...)

## Summary

Formats and prints a message with a variable number of arguments to the console

## Description

This function formats and prints a message with a variable number of arguments to the console.

## Precondition

SYS_CONSOLE_Initialize must have returned a valid object handle.

## Parameters

Param | Description
--- | ---
handle | Handle to a console instance
format | Pointer to a buffer containing the format string for the message to be displayed.
... | Zero or more optional parameters to be formated as defined by the format string.

## Returns

None.

## Example

    SYS_CONSOLE_HANDLE myConsoleHandle;

    myConsoleHandle = SYS_CONSOLE_HandleGet(SYS_CONSOLE_INDEX_0);

    uint8_t num_bytes_to_enter = 10;

    if (myConsoleHandle != SYS_CONSOLE_HANDLE_INVALID)
    {
        // Found a valid handle to the console instance
        SYS_CONSOLE_Print(myConsoleHandle, "Enter %d characters", num_bytes_to_enter);
    }

## Remarks

The format string and arguments follow the printf convention. Call SYS_CONSOLE_PRINT macro to print on the default console instance 0