update bluetooth driver (made a start)

This commit is contained in:
Sem van der Hoeven
2024-01-13 23:47:31 +01:00
parent b61fc4c8a1
commit 3ea9e7bfe4
4 changed files with 41 additions and 7 deletions

View File

@@ -21,4 +21,23 @@ Be sure to disconnect the TX and RX pins from the BT module when programming the
#ifndef OBD2_BT_H
#define OBD2_BT_H
#define BT_STATE_PIN 3 /* state connection pin from bluetooth module -> level high on connected */
enum BluetoothState
{
BT_INITIALISING = 0,
BT_CONNECTING = 1,
BT_CONNECTED = 2
};
typedef struct obt2_bt_tag
{
enum BluetoothState state;
void (*on_state_change)();
} obd2_bt_t;
void obd2_bt_init(obd2_bt_t *bt);
void obd2_bt_process(obd2_bt_t *bt);
#endif // OBD2_BT_H