This file implements the APIs for the OPTIGA library logger. More...
#include "optiga_lib_common.h"
#include "optiga_lib_logger.h"
#include "pal_logger.h"
#include "pal_os_memory.h"
#define | OPTIGA_LOGGER_NEW_LINE_CHAR 0x0D, 0x0A |
#define | OPTIGA_LOGGER_CONVERT_BYTE_TO_HEX(hex_byte, p_hex_string, index) |
pal_logger_t | logger_console |
_STATIC_H void | optiga_lib_byte_to_hex_string (const uint8_t *p_array_buffer, uint8_t *p_hex_string, uint32_t length, bool_t is_input_byte_array) |
_STATIC_H void | optiga_lib_word_to_hex_string (uint16_t value, uint8_t *p_buffer) |
_STATIC_H void | optiga_lib_print_length_of_data (uint16_t value) |
void | optiga_lib_print_string (const char_t *p_log_string) |
To log a string. More... | |
void | optiga_lib_print_string_with_newline (const char_t *p_log_string) |
To log a string with a new line. More... | |
void | optiga_lib_print_message (const char_t *p_log_string, const char_t *p_log_layer, const char_t *p_log_color) |
To log a string with a new line and layer information. More... | |
void | optiga_lib_print_status (const char_t *p_log_layer, const char_t *p_log_color, uint16_t return_value) |
To log a return value with a new line and layer information. More... | |
void | optiga_lib_print_array_hex_format (const uint8_t *p_log_string, uint16_t length, const char_t *p_log_color) |
To log the byte array in hex format. More... | |
This file implements the APIs for the OPTIGA library logger.
Copyright (c) 2019 Infineon Technologies AG
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
\endcopyright
#define OPTIGA_LOGGER_CONVERT_BYTE_TO_HEX | ( | hex_byte, | |
p_hex_string, | |||
index | |||
) |
#define OPTIGA_LOGGER_NEW_LINE_CHAR 0x0D, 0x0A |
_STATIC_H void optiga_lib_byte_to_hex_string | ( | const uint8_t * | p_array_buffer, |
uint8_t * | p_hex_string, | ||
uint32_t | length, | ||
bool_t | is_input_byte_array | ||
) |
void optiga_lib_print_array_hex_format | ( | const uint8_t * | p_log_string, |
uint16_t | length, | ||
const char_t * | p_log_color | ||
) |
To log the byte array in hex format.
To log the byte array in hex format
[in] | p_log_string | Pointer to the array string |
[in] | length | Length of the array buffer |
[in] | p_log_color | Pointer to the color of array string |
_STATIC_H void optiga_lib_print_length_of_data | ( | uint16_t | value | ) |
void optiga_lib_print_message | ( | const char_t * | p_log_string, |
const char_t * | p_log_layer, | ||
const char_t * | p_log_color | ||
) |
To log a string with a new line and layer information.
To log a string with information of the layer from which it is invoked and with a new line
[in] | p_log_string | Pointer to the log string |
[in] | p_log_layer | Pointer to the invoked layer information |
[in] | p_log_color | Pointer to the color of log string |
void optiga_lib_print_status | ( | const char_t * | p_log_layer, |
const char_t * | p_log_color, | ||
uint16_t | return_value | ||
) |
To log a return value with a new line and layer information.
To log a if the return value was successful or not along with layer information
[in] | p_log_layer | Pointer to the invoked layer information |
[in] | p_log_color | Pointer to the color of log string |
[in] | return_value | Return value from the invoked layer |
void optiga_lib_print_string | ( | const char_t * | input_string | ) |
To log a string.
To log a string.
[in] | input_string | Pointer to the log string |
void optiga_lib_print_string_with_newline | ( | const char_t * | p_log_string | ) |
To log a string with a new line.
To log a string with a new line
[in] | p_log_string | Pointer to the log string |
_STATIC_H void optiga_lib_word_to_hex_string | ( | uint16_t | value, |
uint8_t * | p_buffer | ||
) |
pal_logger_t logger_console |