FreeHIL
Loading...
Searching...
No Matches
FH_ErrorInfo.c
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/* Includes ------------------------------------------------------------------*/
35
36/**
37 * @brief This function initializes the error information before calling different functions\n
38 * The <b>FH_ErrorInfo</b> is a structure where <b>error_code</b> and <b>error_message</b> are the members \n
39 * There are different error codes available which are all defined in <b>FH_ErrorInfo.h</b>\n
40 * This function initializes the <b>error code</b> with <b>FH_ERROR_NoInfo</b> and the <b>error message</b> with <b>""</b>
41 *
42 * @param fh_ErrorInfo
43 * it is a pointer to the structure <b>FH_ErrorInfo</b>
44 *
45 * @return None
46 *
47 * @note
48 * In order not to initialize the fh_ErrorInfo repeatedly (whenever needed), this function is utilized\n
49 *
50
51*/
53{
54 fh_ErrorInfo -> error_code = FH_ERROR_NoInfo; // Initialize the error code with FH_ERROR_NoInfo as No Information
55 fh_ErrorInfo -> error_message = ""; // Initialize the error message with "" as null human readable message
56}