rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions | Variables
malfunction_central.cpp File Reference

Functions

void clearWarnings (void)
 
static int find_position (ObdCode e_code)
 
void addError (ObdCode errorCode)
 Adds an error code into the set of current errors. The error code is placed into the fixed-size data structure if it fits into it. The error code stays in the data structure till it is removed by 'clearError'.
 
void removeError (ObdCode errorCode)
 Removed the error code from the set of current errors.
 
void getErrorCodes (error_codes_set_s *copy)
 Copies the current set of errors into the specified buffer.
 
bool hasErrorCodes (void)
 

Variables

static error_codes_set_s error_codes_set
 

Function Documentation

◆ addError()

void addError ( ObdCode  errorCode)

Adds an error code into the set of current errors. The error code is placed into the fixed-size data structure if it fits into it. The error code stays in the data structure till it is removed by 'clearError'.

Definition at line 35 of file malfunction_central.cpp.

35 {
36 if (error_codes_set.count < MAX_ERROR_CODES_COUNT && find_position(errorCode) == -1) {
39 }
40}
static error_codes_set_s error_codes_set
static int find_position(ObdCode e_code)
ObdCode error_codes[MAX_ERROR_CODES_COUNT]

Referenced by testMil().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearWarnings()

void clearWarnings ( void  )

Definition at line 17 of file malfunction_central.cpp.

17 {
19}

Referenced by executeTSCommand().

Here is the caller graph for this function:

◆ find_position()

static int find_position ( ObdCode  e_code)
static

Search if code is present

Returns
-1 if code not found

Definition at line 27 of file malfunction_central.cpp.

27 {
28 // cycle for searching element equal seaching code
29 for (int t = 0; t < error_codes_set.count; t++)
30 if (error_codes_set.error_codes[t] == e_code)
31 return t; // we found position where this code is present
32 return -1; // -1 if code not found
33}

Referenced by addError(), and removeError().

Here is the caller graph for this function:

◆ getErrorCodes()

void getErrorCodes ( error_codes_set_s copy)

Copies the current set of errors into the specified buffer.

Definition at line 55 of file malfunction_central.cpp.

55 {
57 copyArray(copy->error_codes, error_codes_set.error_codes);
58}

◆ hasErrorCodes()

bool hasErrorCodes ( void  )

Definition at line 60 of file malfunction_central.cpp.

60 {
61 return error_codes_set.count > 0;
62}

Referenced by updateTunerStudioState().

Here is the caller graph for this function:

◆ removeError()

void removeError ( ObdCode  errorCode)

Removed the error code from the set of current errors.

Definition at line 42 of file malfunction_central.cpp.

42 {
43 int pos = find_position(errorCode);
44 if (pos >= 0) {
45 // shift all right elements to one pos left
46 for (int t = pos; t < error_codes_set.count - 1; t++) {
48 }
49
51 }
52}
ObdCode
Here is the call graph for this function:

Variable Documentation

◆ error_codes_set

error_codes_set_s error_codes_set
static

Go to the source code of this file.