2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file malfunction_central.h
|
|
|
|
* @brief This data structure holds current malfunction codes
|
|
|
|
*
|
|
|
|
* @date Dec 20, 2013
|
2015-12-31 13:02:30 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2016
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MALFUNCTION_CENTRAL_H_
|
|
|
|
#define MALFUNCTION_CENTRAL_H_
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "main.h"
|
|
|
|
#include "obd_error_codes.h"
|
|
|
|
|
|
|
|
#define MAX_ERROR_CODES_COUNT 10
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int count;
|
|
|
|
obd_code_e error_codes[MAX_ERROR_CODES_COUNT];
|
|
|
|
} error_codes_set_s;
|
|
|
|
|
|
|
|
void initMalfunctionCentral(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief 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 addError(obd_code_e errorCode);
|
|
|
|
/**
|
|
|
|
* @brief Removed the error code from the set of current errors.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void removeError(obd_code_e errorCode);
|
|
|
|
|
2016-01-11 14:01:33 -08:00
|
|
|
void setError(bool isError, obd_code_e errorCode);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Copies the current set of errors into the specified buffer
|
|
|
|
*/
|
|
|
|
void getErrorCodes(error_codes_set_s * buffer);
|
|
|
|
|
|
|
|
bool hasErrorCodes(void);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
#endif /* MALFUNCTION_CENTRAL_H_ */
|