ErrorLib 1.0.14-master SHA: 787260c7d1
Error.h File Reference

Error and Warnings Plugin for Hermes PC-Tool. More...

#include <stdint.h>
#include "timestamp.h"

Go to the source code of this file.

Data Structures

struct  tOnErrorReaction
 The error reaction is called on occurence of the error. More...
 
struct  tOnErrorResetReaction
 The error reset reaction is called on reset of the error. More...
 
struct  tError
 Main error structure. More...
 
struct  tErrorSource
 Structure used in tError holding source-code file an line. More...
 
struct  tErrorListItem
 Structure used in the error stack. More...
 

Macros

#define static_assert   _Static_assert
 
#define MAX_NUMBER_OF_ERRORS   30
 Size of the error stack. More...
 
#define MIN_ERR_REACTION_NAME_LENTH   10
 Minimum lenght of error-reaction description string. More...
 
#define MIN_DESCRIPTION_LENTH   10
 Minimum lenght of description-string. More...
 
#define MIN_HELP_LENTH   20
 Minimum lenght of help-string. More...
 
#define ERROR_STACK_OVERFLOW   0x80000000
 Flag used in g_u32ErrorPending to indicate an error stack overflow. More...
 
#define ERROR_SYSTEM_VERSION   2
 Version of this error-library. More...
 
#define ERR_VAR_NAME_SRT(x, y)   x ## y
 Helper Macro to add a variable name to help-text. More...
 
#define ERR_VAR_NAME(x, y)   ERR_VAR_NAME_SRT(x, y)
 Helper Macro to add a variable name to help-text. More...
 
#define xstr(s)   str(s)
 Helper Macro to convert to string. More...
 
#define str(s)   #s
 Helper Macro to convert to string. More...
 
#define ASSERT_REACTION_NAME(NAME)
 Test if strings are too short. More...
 
#define ASSERT_DESCRIPTION(DESCRIPTION)
 Test if strings are too short. More...
 
#define ASSERT_HELP(HELP)
 Test if strings are too short. More...
 

Typedefs

typedef void(* fpOnErrorX) (void)
 Structure used in tError to describe a function to be called on error set. More...
 
typedef bool(* fpOnErrorResetX) (void)
 Structure used in tError to describe a function to be called on error reset. More...
 

Enumerations

enum  ERROR_FLAGS {
  VIEWER_RESET = 1 , USER_RESET = 2 , PROFESSIONAL_RESET = 4 , DEVELOPER_RESET = 8 ,
  PLC_RESET = 16 , CODE_RESET = 32 , NV_STORED = 64
}
 Flags used for errors. More...
 

Variables

uint32_t g_u32ErrorPending
 

Detailed Description

Error and Warnings Plugin for Hermes PC-Tool.


© Copyright 2017-2022 Copyright: Retostronik GmbH Stütingstraße 30 58285 Gevelsberg

Macro Definition Documentation

◆ ASSERT_DESCRIPTION

#define ASSERT_DESCRIPTION (   DESCRIPTION)
Value:
static_assert(sizeof(DESCRIPTION) > MIN_DESCRIPTION_LENTH, \
"Error description text to short must be at least "xstr(MIN_DESCRIPTION_LENTH)" characters long!") \
#define MIN_DESCRIPTION_LENTH
Minimum lenght of description-string.
Definition: Error.h:41
#define xstr(s)
Helper Macro to convert to string.
Definition: Error.h:137

Test if strings are too short.

◆ ASSERT_HELP

#define ASSERT_HELP (   HELP)
Value:
static_assert(sizeof(HELP) > MIN_HELP_LENTH, \
"Error help text to short must be at least "xstr(MIN_HELP_LENTH)" characters long!") \
#define MIN_HELP_LENTH
Minimum lenght of help-string.
Definition: Error.h:43

Test if strings are too short.

◆ ASSERT_REACTION_NAME

#define ASSERT_REACTION_NAME (   NAME)
Value:
static_assert(sizeof(NAME) > MIN_ERR_REACTION_NAME_LENTH, \
"Error reaction name to short must be at least "xstr(MIN_ERR_REACTION_NAME_LENTH)" characters long!") \
#define MIN_ERR_REACTION_NAME_LENTH
Minimum lenght of error-reaction description string.
Definition: Error.h:39

Test if strings are too short.

◆ ERR_VAR_NAME

#define ERR_VAR_NAME (   x,
  y 
)    ERR_VAR_NAME_SRT(x, y)

Helper Macro to add a variable name to help-text.

◆ ERR_VAR_NAME_SRT

#define ERR_VAR_NAME_SRT (   x,
  y 
)    x ## y

Helper Macro to add a variable name to help-text.

◆ ERROR_STACK_OVERFLOW

#define ERROR_STACK_OVERFLOW   0x80000000

Flag used in g_u32ErrorPending to indicate an error stack overflow.

◆ ERROR_SYSTEM_VERSION

#define ERROR_SYSTEM_VERSION   2

Version of this error-library.

◆ MAX_NUMBER_OF_ERRORS

#define MAX_NUMBER_OF_ERRORS   30

Size of the error stack.

Maximum value is 31

◆ MIN_DESCRIPTION_LENTH

#define MIN_DESCRIPTION_LENTH   10

Minimum lenght of description-string.

◆ MIN_ERR_REACTION_NAME_LENTH

#define MIN_ERR_REACTION_NAME_LENTH   10

Minimum lenght of error-reaction description string.

◆ MIN_HELP_LENTH

#define MIN_HELP_LENTH   20

Minimum lenght of help-string.

◆ static_assert

#define static_assert   _Static_assert

◆ str

#define str (   s)    #s

Helper Macro to convert to string.

◆ xstr

#define xstr (   s)    str(s)

Helper Macro to convert to string.

Typedef Documentation

◆ fpOnErrorResetX

typedef bool(* fpOnErrorResetX) (void)

Structure used in tError to describe a function to be called on error reset.

The function must return true in case the error is allowed to reset.

◆ fpOnErrorX

typedef void(* fpOnErrorX) (void)

Structure used in tError to describe a function to be called on error set.

Enumeration Type Documentation

◆ ERROR_FLAGS

Flags used for errors.

must macht the enum ACCESS_LEVEL in PARA_Lib.h

Enumerator
VIEWER_RESET 

Can be reset by user with Viewer access level.

USER_RESET 

Can be reset by user with User access level.

PROFESSIONAL_RESET 

Can be reset by user with Professional access level.

DEVELOPER_RESET 

Can be reset by user with Developer access level.

PLC_RESET 

Can be reset by the PLC.

CODE_RESET 

Can be reset by the program it-selve e.g. after Init.

NV_STORED 

Stored in Non-Volatile RAM.

Variable Documentation

◆ g_u32ErrorPending

uint32_t g_u32ErrorPending
extern