![]() |
ErrorLib 1.0.11-master SHA: 046b1d10ed
|
Logmessage Plugin for Hermes PC-Tool. More...
#include <string.h>#include <stdio.h>#include <stdarg.h>#include "LogMessage.h"#include "../lib/Para/PARA_Lib.h"#include "../lib/Para/PARA_ID_System.h"#include "../lib/Para/PARA_MemoryInfo.h"#include "timestamp.h"Functions | |
| static void | AddTimestamp (uint32_t Position) |
| Add Timestamp to Message Buffer. More... | |
| static uint32_t | reserveLogmessageBufferPosition (uint32_t length) |
| Reserve Buffer Position for actual Message. More... | |
| void | LogMessage_Init (void) |
| Init the Logmessage System. More... | |
| __WEAK void | OnLogMessage () |
| This function is called on every Logmessage. More... | |
| void | _LogMessage (const char str[], uint32_t ui32Options) |
| Add a static String to the Message Buffer. More... | |
| void | DynamicString (char *str, uint32_t ui32Options) |
| Add a dynamic String to the Message Buffer. More... | |
| void | _LogmessageData (const char *Message, uint32_t ui32Options, uint32_t ui32DataCount,...) |
| Add a const String to the Message Buffer and adds additional Data. More... | |
| static int32_t | ReadFunction_LogBufferAddress (Parameter *this, uint16_t SubID, void *data, int32_t MaxCount, uint32_t offset, ParameterAccessSource Access, uint8_t access_level) |
| ASSERT_PARA_NAME ("LogMessageBufferAddress") | |
| ASSERT_PARA_DESCRIPTION ("Address of Logmessage Buffer") | |
| ASSERT_PARA_HELP ("") | |
| PARA_HELP_TEXT_SECTION (130, PARA_HELP_TEXT_COMBINE(INCLUDE_HELP_EN("DOC_E " "") INCLUDE_HELP_DE("DOC_D " ""))) const | |
| static int32_t | ReadFunction_LogBufferSize (Parameter *this, uint16_t SubID, void *data, int32_t MaxCount, uint32_t offset, ParameterAccessSource Access, uint8_t access_level) |
| ASSERT_PARA_NAME ("LogMessageBufferSize") | |
| ASSERT_PARA_DESCRIPTION ("Size of Logmessage Buffer") | |
| PARA_HELP_TEXT_SECTION (131, PARA_HELP_TEXT_COMBINE(INCLUDE_HELP_EN("DOC_E " "") INCLUDE_HELP_DE("DOC_D " ""))) const | |
| ASSERT_PARA_NAME ("LogMessageBufferPosition") | |
| ASSERT_PARA_DESCRIPTION ("Actual Position in Logmessage Buffer") | |
| PARA_HELP_TEXT_SECTION (132, PARA_HELP_TEXT_COMBINE(INCLUDE_HELP_EN("DOC_E " "") INCLUDE_HELP_DE("DOC_D " ""))) const | |
| ASSERT_PARA_NAME ("LogMessage Overflow Counter") | |
| ASSERT_PARA_DESCRIPTION ("Counter of Logmessage Buffer Overflows") | |
| PARA_HELP_TEXT_SECTION (133, PARA_HELP_TEXT_COMBINE(INCLUDE_HELP_EN("DOC_E " "") INCLUDE_HELP_DE("DOC_D " ""))) const | |
| ASSERT_PARA_NAME ("LogMessageAlertAddress") | |
| ASSERT_PARA_DESCRIPTION ("Address of Alert Message to User") | |
| PARA_HELP_TEXT_SECTION (134, PARA_HELP_TEXT_COMBINE(INCLUDE_HELP_EN("DOC_E " "") INCLUDE_HELP_DE("DOC_D " ""))) const | |
Variables | |
| const uint32_t | cui32_LogmessageBufferSize = 1000 |
| Size of the Logmessage buffer. More... | |
| uint32_t | g_pui32LogmessageBuffer [1000/4] |
| Buffer for storing the logmessages. More... | |
| uint32_t | g_ui32LogmessageBufferPosition =0 |
| Actual position in the logmessage buffer. More... | |
| uint32_t | g_ui32LogmessageBufferOverflowCounter =0 |
| Number of overflows of the logmessage buffer. More... | |
| uint32_t | g_ui32LogmessageAlertAddress =0 |
| Address of an alert message. More... | |
| static uint32_t * | g_pui32LogmessageLastMessageBufferRepeat =0 |
| Address of the Logmessage Repeated Counter. More... | |
| static uint32_t | g_ui32LogmessageLastMessagePosition =0 |
| Startposition of the last logmessage. More... | |
| const ParaData_U32 | g_tParaData_PARA_ID_LogMessageBufferAddress = { 0 , 0x00000000 , 0xFFFFFFFF , 0 } |
| static const char | g_sParaNamePARA_ID_LogMessageBufferAddress [] = "LogMessageBufferAddress" |
| static const char | g_sParaUnitPARA_ID_LogMessageBufferAddress [] = "0x{0:X8}" |
| static const char | g_sParaSubstitutionTextPARA_ID_LogMessageBufferAddress [] = "" |
| static const char | g_sParaDescriptionPARA_ID_LogMessageBufferAddress [] = "Address of Logmessage Buffer" PARA_HELP_TEXT_COMBINE(INCLUDE_HELP_EN("DOC_E " "" ) INCLUDE_HELP_DE("DOC_D " "" )) |
| const ParaData_U32 | g_tParaData_PARA_ID_LogMessageBufferSize = { 0 , 0x00000000 , 0xFFFFFFFF , 0 } |
| static const char | g_sParaNamePARA_ID_LogMessageBufferSize [] = "LogMessageBufferSize" |
| static const char | g_sParaUnitPARA_ID_LogMessageBufferSize [] = "{0}" |
| static const char | g_sParaSubstitutionTextPARA_ID_LogMessageBufferSize [] = "" |
| static const char | g_sParaDescriptionPARA_ID_LogMessageBufferSize [] = "Size of Logmessage Buffer" PARA_HELP_TEXT_COMBINE(INCLUDE_HELP_EN("DOC_E " "" ) INCLUDE_HELP_DE("DOC_D " "" )) |
| const ParaData_U32 | g_tParaData_PARA_ID_LogMessageBufferPosition = { &g_ui32LogmessageBufferPosition , 0x00000000 , 0xFFFFFFFF , 0 } |
| static const char | g_sParaNamePARA_ID_LogMessageBufferPosition [] = "LogMessageBufferPosition" |
| static const char | g_sParaUnitPARA_ID_LogMessageBufferPosition [] = "{0}" |
| static const char | g_sParaSubstitutionTextPARA_ID_LogMessageBufferPosition [] = "" |
| static const char | g_sParaDescriptionPARA_ID_LogMessageBufferPosition [] = "Actual Position in Logmessage Buffer" PARA_HELP_TEXT_COMBINE(INCLUDE_HELP_EN("DOC_E " "" ) INCLUDE_HELP_DE("DOC_D " "" )) |
| const ParaData_U32 | g_tParaData_PARA_ID_LogMessageBufferOverflowCounter = { &g_ui32LogmessageBufferOverflowCounter , 0x00000000 , 0xFFFFFFFF , 0 } |
| static const char | g_sParaNamePARA_ID_LogMessageBufferOverflowCounter [] = "LogMessage Overflow Counter" |
| static const char | g_sParaUnitPARA_ID_LogMessageBufferOverflowCounter [] = "{0}" |
| static const char | g_sParaSubstitutionTextPARA_ID_LogMessageBufferOverflowCounter [] = "" |
| static const char | g_sParaDescriptionPARA_ID_LogMessageBufferOverflowCounter [] = "Counter of Logmessage Buffer Overflows" PARA_HELP_TEXT_COMBINE(INCLUDE_HELP_EN("DOC_E " "" ) INCLUDE_HELP_DE("DOC_D " "" )) |
| const ParaData_U32 | g_tParaData_PARA_ID_LogMessageAlertAddress = { &g_ui32LogmessageAlertAddress , 0x00000000 , 0xFFFFFFFF , 0 } |
| static const char | g_sParaNamePARA_ID_LogMessageAlertAddress [] = "LogMessageAlertAddress" |
| static const char | g_sParaUnitPARA_ID_LogMessageAlertAddress [] = "0x{0:X8}" |
| static const char | g_sParaSubstitutionTextPARA_ID_LogMessageAlertAddress [] = "" |
| static const char | g_sParaDescriptionPARA_ID_LogMessageAlertAddress [] = "Address of Alert Message to User" PARA_HELP_TEXT_COMBINE(INCLUDE_HELP_EN("DOC_E " "" ) INCLUDE_HELP_DE("DOC_D " "" )) |
Logmessage Plugin for Hermes PC-Tool.
© Copyright 2017-2022 Copyright: Retostronik GmbH Stütingstraße 30 58285 Gevelsberg
| #define LOGMESSAGE_BUFFER_LENGTH LOGMESSAGE_MEMORY_SIZE/4 |
| #define LOGMESSAGE_CODESECTION |
You can place Logmessage-System in ITCM if required Default is no special Codesection.
| #define LOGMESSAGE_LENGTH_CONSTSTRING LOGMESSAGE_LENGTH_MESSAGETYPE + 1 |
| #define LOGMESSAGE_LENGTH_DATA LOGMESSAGE_LENGTH_MESSAGETYPE |
| #define LOGMESSAGE_LENGTH_DYNSTRING LOGMESSAGE_LENGTH_MESSAGETYPE |
| #define LOGMESSAGE_LENGTH_MASK 0x000000FF |
| #define LOGMESSAGE_LENGTH_MAXIMUM 255 |
| #define LOGMESSAGE_LENGTH_MESSAGETYPE 1 |
| #define LOGMESSAGE_LENGTH_REPEATS LOGMESSAGE_LENGTH_MESSAGETYPE + 1 |
| #define LOGMESSAGE_LENGTH_TIMESTAMP 2 |
| #define LOGMESSAGE_MAX_DYNSTRING_LENGTH 100 |
Maximum Length of dynamic allocated Strings.
| #define LOGMESSAGE_MEMORY_SIZE 1000 |
Logmessage Buffer size.
Memory reserved for Logmessages
| #define LOGMESSAGE_OPTION_MASK 0x0000FF00 |
| #define LOGMESSAGE_START_BYTE 0xAA000000 |
| #define LOGMESSAGE_TYPE_CONSTSTRING 0x00010000 |
| #define LOGMESSAGE_TYPE_DATA 0x00040000 |
| #define LOGMESSAGE_TYPE_DYNSTRING 0x00030000 |
| #define LOGMESSAGE_TYPE_MASK 0x00FF0000 |
| #define LOGMESSAGE_TYPE_OVERFLOW 0x00FF0000 |
| #define LOGMESSAGE_TYPE_REPEATS 0x00020000 |
| #define MIN_PARA_DESCRIPTION_LENTH 0 |
| #define MIN_PARA_HELP_LENTH 0 |
| void _LogMessage | ( | const char | str[], |
| uint32_t | ui32Options | ||
| ) |
Add a static String to the Message Buffer.
| str | String to Add. The String must be a const String located in flash |
| ui32Options | Options flags LOGMESSAGE_OPTION_ALERT, LOGMESSAGE_OPTION_DEBUG, LOGMESSAGE_OPTION_TIMESTAMP |
| void _LogmessageData | ( | const char * | Message, |
| uint32_t | ui32Options, | ||
| uint32_t | ui32DataCount, | ||
| ... | |||
| ) |
Add a const String to the Message Buffer and adds additional Data.
A Timestamp is added to this message. Repeated Messages counter is not used.
| Message | String to Add. The String must be a const String located in flash. |
| ui32Options | Options flags if required. |
| ui32DataCount | Count of added Data pointers |
| ... | additional Pointers to Data. Each Pointer can be any datatype up to 32 Bit length. |
|
inlinestatic |
Add Timestamp to Message Buffer.
There must be 8 Bytes of free Space.
| Position | Position of the MessageBuffer for the Timestamp. |
| ASSERT_PARA_DESCRIPTION | ( | "Actual Position in Logmessage Buffer" | ) |
| ASSERT_PARA_DESCRIPTION | ( | "Address of Alert Message to User" | ) |
| ASSERT_PARA_DESCRIPTION | ( | "Address of Logmessage Buffer" | ) |
| ASSERT_PARA_DESCRIPTION | ( | "Counter of Logmessage Buffer Overflows" | ) |
| ASSERT_PARA_DESCRIPTION | ( | "Size of Logmessage Buffer" | ) |
| ASSERT_PARA_HELP | ( | "" | ) |
| ASSERT_PARA_NAME | ( | "LogMessage Overflow Counter" | ) |
| ASSERT_PARA_NAME | ( | "LogMessageAlertAddress" | ) |
| ASSERT_PARA_NAME | ( | "LogMessageBufferAddress" | ) |
| ASSERT_PARA_NAME | ( | "LogMessageBufferPosition" | ) |
| ASSERT_PARA_NAME | ( | "LogMessageBufferSize" | ) |
| void DynamicString | ( | char * | str, |
| uint32_t | ui32Options | ||
| ) |
Add a dynamic String to the Message Buffer.
The dynamic string must be located in memory.
| str | String to Add. This can be a local Variable. The String is copied to the Message Buffer |
| ui32Options | Options flags LOGMESSAGE_OPTION_TIMESTAMP if required. |
| void LogMessage_Init | ( | void | ) |
Init the Logmessage System.
Must be called before usage of all other functions in this library.
| __WEAK void OnLogMessage | ( | ) |
This function is called on every Logmessage.
This weak definition is empty and can be overwritten by main project if an action is required.
| PARA_HELP_TEXT_SECTION | ( | 130 | , |
| PARA_HELP_TEXT_COMBINE(INCLUDE_HELP_EN("DOC_E " "") INCLUDE_HELP_DE("DOC_D " "")) | |||
| ) | const |
| PARA_HELP_TEXT_SECTION | ( | 131 | , |
| PARA_HELP_TEXT_COMBINE(INCLUDE_HELP_EN("DOC_E " "") INCLUDE_HELP_DE("DOC_D " "")) | |||
| ) | const |
| PARA_HELP_TEXT_SECTION | ( | 132 | , |
| PARA_HELP_TEXT_COMBINE(INCLUDE_HELP_EN("DOC_E " "") INCLUDE_HELP_DE("DOC_D " "")) | |||
| ) | const |
| PARA_HELP_TEXT_SECTION | ( | 133 | , |
| PARA_HELP_TEXT_COMBINE(INCLUDE_HELP_EN("DOC_E " "") INCLUDE_HELP_DE("DOC_D " "")) | |||
| ) | const |
| PARA_HELP_TEXT_SECTION | ( | 134 | , |
| PARA_HELP_TEXT_COMBINE(INCLUDE_HELP_EN("DOC_E " "") INCLUDE_HELP_DE("DOC_D " "")) | |||
| ) | const |
|
static |
|
static |
|
inlinestatic |
Reserve Buffer Position for actual Message.
The Message Pointer is moved behind the Memory reserved for the new Message. Must be Thread-Save.
| length | Length of the Message including the Type-Word |
| const uint32_t cui32_LogmessageBufferSize = 1000 |
Size of the Logmessage buffer.
| uint32_t g_pui32LogmessageBuffer[ 1000/4] |
Buffer for storing the logmessages.
|
static |
Address of the Logmessage Repeated Counter.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| const ParaData_U32 g_tParaData_PARA_ID_LogMessageAlertAddress = { &g_ui32LogmessageAlertAddress , 0x00000000 , 0xFFFFFFFF , 0 } |
| const ParaData_U32 g_tParaData_PARA_ID_LogMessageBufferAddress = { 0 , 0x00000000 , 0xFFFFFFFF , 0 } |
| const ParaData_U32 g_tParaData_PARA_ID_LogMessageBufferOverflowCounter = { &g_ui32LogmessageBufferOverflowCounter , 0x00000000 , 0xFFFFFFFF , 0 } |
| const ParaData_U32 g_tParaData_PARA_ID_LogMessageBufferPosition = { &g_ui32LogmessageBufferPosition , 0x00000000 , 0xFFFFFFFF , 0 } |
| const ParaData_U32 g_tParaData_PARA_ID_LogMessageBufferSize = { 0 , 0x00000000 , 0xFFFFFFFF , 0 } |
| uint32_t g_ui32LogmessageAlertAddress =0 |
Address of an alert message.
| uint32_t g_ui32LogmessageBufferOverflowCounter =0 |
Number of overflows of the logmessage buffer.
| uint32_t g_ui32LogmessageBufferPosition =0 |
Actual position in the logmessage buffer.
|
static |
Startposition of the last logmessage.