add comments to bluetooth driver

This commit is contained in:
Sem van der Hoeven
2024-01-14 12:57:06 +01:00
parent 15d560f426
commit a81322e46d

View File

@@ -45,14 +45,38 @@ enum BluetoothState
BT_CONNECTED = 2 BT_CONNECTED = 2
}; };
/**
* @brief struct to hold bluetooth module data
*
* @param state the current state of the bluetooth module
* @param on_state_change function pointer to the function to be called when the state changes
*/
typedef struct obt2_bt_tag typedef struct obt2_bt_tag
{ {
enum BluetoothState state; enum BluetoothState state;
void (*on_state_change)(); void (*on_state_change)();
} obd2_bt_t; } obd2_bt_t;
/**
* @brief initializes the bluetooth module driver
*
* @param bt pointer to struct holding bluetooth driver data
*/
void obd2_bt_init(obd2_bt_t *bt); void obd2_bt_init(obd2_bt_t *bt);
/**
* @brief processes the bluetooth module communication with the OBD2 reader
*
* @param bt pointer to struct holding bluetooth driver data
*/
void obd2_bt_process(obd2_bt_t *bt); void obd2_bt_process(obd2_bt_t *bt);
/**
* @brief copies the current state of the bluetooth module to the state string
*
* @param bt pointer to struct holding bluetooth driver data
* @param state resulting string to hold the text representation of the state
*/
void obd2_bt_get_state(obd2_bt_t *bt, char *state); void obd2_bt_get_state(obd2_bt_t *bt, char *state);
#ifdef __cplusplus #ifdef __cplusplus