rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Data Structures | Functions
malfunction_central.h File Reference

Detailed Description

This data structure holds current malfunction codes.

Date
Dec 20, 2013
Author
Andrey Belomutskiy, (c) 2012-2020

Definition in file malfunction_central.h.

Data Structures

struct  error_codes_set_s
 

Functions

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 clearWarnings (void)
 
void getErrorCodes (error_codes_set_s *buffer)
 Copies the current set of errors into the specified buffer.
 
bool hasErrorCodes (void)
 

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:

◆ getErrorCodes()

void getErrorCodes ( error_codes_set_s buffer)

Copies the current set of errors into the specified buffer.

Definition at line 55 of file malfunction_central.cpp.

55 {
56 copy->count = error_codes_set.count;
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:

Go to the source code of this file.