FreeHIL
Loading...
Searching...
No Matches
FH_ErrorInfo.h
Go to the documentation of this file.
1/**
2 * @file
3 * @brief
4 * <b>File Map:</b>\n
5 * <b>FH_Root</b>, Section <b>FH_General</b>, <b>FH_ErrorInfo</b> \n
6 * To monitor different possible errors in different parts of the code, <b>FH_ErrorInfo</b> structure is utilized\n
7 * The <b>FH_ErrorInfo</b> is a structure where <b>error_code</b> and <b>error_message</b> are the members \n
8 *
9 * @attention <b>FH</b> user could left this file intact
10 *
11 *******************************************************************************
12 * SPDX-License-Identifier: Apache-2.0
13 *
14 * Copyright 2026 Vahid Hasirchi
15 *
16 * Licensed under the Apache License, Version 2.0 (the "License");
17 * you may not use this file except in compliance with the License.
18 * You may obtain a copy of the License at
19 *
20 * http://www.apache.org/licenses/LICENSE-2.0
21 *
22 * Unless required by applicable law or agreed to in writing, software
23 * distributed under the License is distributed on an "AS IS" BASIS,
24 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25 * See the License for the specific language governing permissions and
26 * limitations under the License.
27 ********************************************************************************
28
29 *
30 * <b>For more information refer to FreeHIL.com</b>
31 *
32*/
33/* Define to prevent recursive inclusion -------------------------------------*/
34#ifndef FH_ErrorInfo_H
35#define FH_ErrorInfo_H
36
37/* Includes ------------------------------------------------------------------*/
38#include "stdint.h"
39
40/*!
41 To monitor different possible errors in different parts of the code, <b>FH_ErrorInfo</b> structure is utilized\n
42 The <b>FH_ErrorInfo</b> is a structure where <b>error_code</b> and <b>error_message</b> are the members
43 The error codes are all defined in FH_ErrorInfo.h
44*/
45typedef struct {
46 /*!
47 Different unique error codes to monitor different possible errors in different parts of the code\n
48 The error codes are all defined in <b>FH_ErrorInfo.h</b>
49 */
50 uint8_t error_code;
51 /*!
52 Different human-readable error messages to monitor different possible errors in different parts of the code
53 */
56
57//
58
59/*!
60 No information (Error codes related to <b>FH_ErrorInfo</b> structure)
61*/
62#define FH_ERROR_NoInfo 0
63/*!
64 No error (Error codes related to <b>FH_ErrorInfo</b> structure)
65*/
66#define FH_ERROR_OK 1
67/*!
68 User defined function error (in compared with FH defined error) (Error codes related to <b>FH_ErrorInfo</b> structure)
69*/
70#define FH_ERROR_Functions 2
71/*!
72 Timeout error (Error codes related to <b>FH_ErrorInfo</b> structure)
73*/
74#define FH_ERROR_Timeout 3
75/*!
76 Message Frame error (Error codes related to <b>FH_ErrorInfo</b> structure)
77*/
78#define FH_ERROR_MessageFrame 4
79/*!
80 FH defined function error (in compared with user defined error) (Error codes related to <b>FH_ErrorInfo</b> structure)
81*/
82#define FH_ERROR_Root 5
83/*!
84 General error (Error codes related to <b>FH_ErrorInfo</b> structure)
85*/
86#define FH_ERROR_General 6
87
88/* Function Prototypes -----------------------------------------------------*/
89void FH_ResetErrorInfo(FH_ErrorInfo *fh_ErrorInfo);
90
91#endif // FH_ErrorInfo_H