fome-fw/firmware/controllers/gauges/malfunction_central.h

42 lines
953 B
C
Raw Normal View History

2015-07-10 06:01:56 -07:00
/**
* @file malfunction_central.h
* @brief This data structure holds current malfunction codes
*
* @date Dec 20, 2013
2020-01-13 18:57:43 -08:00
* @author Andrey Belomutskiy, (c) 2012-2020
2015-07-10 06:01:56 -07:00
*/
2020-03-24 16:21:20 -07:00
#pragma once
2015-07-10 06:01:56 -07:00
#include "obd_error_codes.h"
#define MAX_ERROR_CODES_COUNT 10
struct error_codes_set_s {
2020-03-24 16:21:20 -07:00
int count = 0;
2023-04-11 16:32:47 -07:00
ObdCode error_codes[MAX_ERROR_CODES_COUNT];
};
2015-07-10 06:01:56 -07:00
/**
* @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'
*
*/
2023-04-11 16:32:47 -07:00
void addError(ObdCode errorCode);
2015-07-10 06:01:56 -07:00
/**
* @brief Removed the error code from the set of current errors.
*
*/
2023-04-11 16:32:47 -07:00
void removeError(ObdCode errorCode);
2015-07-10 06:01:56 -07:00
2023-04-11 16:32:47 -07:00
void setError(bool isError, ObdCode errorCode);
2015-07-10 06:01:56 -07:00
2020-03-24 16:21:20 -07:00
void clearWarnings(void);
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);