rusEFI
The most advanced open source ECU
malfunction_central.h
Go to the documentation of this file.
1 /**
2  * @file malfunction_central.h
3  * @brief This data structure holds current malfunction codes
4  *
5  * @date Dec 20, 2013
6  * @author Andrey Belomutskiy, (c) 2012-2020
7  */
8 
9 #pragma once
10 
11 #include "obd_error_codes.h"
12 
13 #define MAX_ERROR_CODES_COUNT 10
14 
16  int count = 0;
17  ObdCode error_codes[MAX_ERROR_CODES_COUNT];
18 };
19 
20 // TODO: wow this is not used by real firmware?!
21 #if EFI_UNIT_TEST
22 /**
23  * @brief Adds an error code into the set of current errors.
24  * The error code is placed into the fixed-size data structure if it fits into it.
25  * The error code stays in the data structure till it is removed by 'clearError'
26  *
27  */
28 void addError(ObdCode errorCode);
29 /**
30  * @brief Removed the error code from the set of current errors.
31  *
32  */
33 void removeError(ObdCode errorCode);
34 #endif // EFI_UNIT_TEST
35 
36 void clearWarnings(void);
37 /**
38  * @brief Copies the current set of errors into the specified buffer
39  */
41 
42 bool hasErrorCodes(void);
void removeError(ObdCode errorCode)
Removed the error code from the set of current errors.
void clearWarnings(void)
void addError(ObdCode errorCode)
Adds an error code into the set of current errors. The error code is placed into the fixed-size data ...
void getErrorCodes(error_codes_set_s *buffer)
Copies the current set of errors into the specified buffer.
bool hasErrorCodes(void)
Standard and custom OBD-II error codes.
ObdCode
ObdCode error_codes[MAX_ERROR_CODES_COUNT]
static BigBufferHandle buffer