This commit is contained in:
Sem van der Hoeven
2024-07-14 21:44:26 +02:00
parent 50fd4c813d
commit f9cef163b9
4 changed files with 307 additions and 153 deletions

View File

@@ -66,6 +66,7 @@ Be sure to disconnect the TX and RX pins from the BT module when programming the
#define UPDATE_FUEL_PRESSURE_POS 0x08
#define UPDATE_SPEED_POS 0x09
#define UPDATE_MANIFOLD_PRESSURE_POS 0x0A
#define UPDATE_FUEL_LEVEL_POS 0x0B
enum BluetoothState
{
@@ -90,12 +91,13 @@ typedef struct obt2_elm327_tag
uint8_t engine_coolant_temp;
uint8_t intake_air_temp;
uint8_t ambient_air_temp;
float engine_oil_temp;
uint16_t engine_oil_temp;
uint8_t engine_load;
float battery_voltage;
float fuel_pressure;
uint16_t fuel_pressure;
uint8_t speed;
uint8_t manifold_pressure;
uint16_t fuel_level;
} obd2_elm327_t;
/**
@@ -107,11 +109,18 @@ typedef struct obt2_elm327_tag
char obd2_elm327_init(obd2_elm327_t *elm327);
/**
* @brief processes the bluetooth module communication with the OBD2 reader
* @brief processes the bluetooth module communication with the OBD2 reader for variables that change quickly
*
* @param bt pointer to struct holding bluetooth driver data
*/
void obd2_elm327_process(obd2_elm327_t *elm327);
void obd2_elm327_process_fast(obd2_elm327_t *elm327);
/**
* @brief processes the bluetooth module communication with the OBD2 reader for variables that change slowly
*
* @param bt pointer to struct holding bluetooth driver data
*/
void obd2_elm327_process_slow(obd2_elm327_t *elm327);
void obd2_elm327_check_connection(obd2_elm327_t *elm327);