2024-11-15 18:35:05 -05:00
|
|
|
#ifndef __BAROS_H__
|
|
|
|
#define __BAROS_H__
|
|
|
|
|
2024-12-02 00:57:17 -05:00
|
|
|
#include <stdint.h>
|
|
|
|
#include "esp_event_base.h"
|
|
|
|
|
2024-11-15 18:35:05 -05:00
|
|
|
#define BAROS_BLE_SERVICE_PUMP_ENABLED (0x4200)
|
|
|
|
#define BAROS_BLE_SERVICE_PUMP_STATE (0x4300)
|
|
|
|
#define BAROS_BLE_SERVICE_PUMP_DURATION (0x4350)
|
|
|
|
|
|
|
|
#define BAROS_BLE_SERVICE_BARBACK (0x4400)
|
|
|
|
|
|
|
|
#define BAROS_CHAR_POUR (BAROS_BLE_SERVICE_BARBACK + 1) // 0x4401
|
|
|
|
#define BAROS_CHAR_BUTTON (BAROS_BLE_SERVICE_BARBACK + 2) // 0x4402
|
|
|
|
|
2024-12-02 00:57:17 -05:00
|
|
|
typedef enum {
|
|
|
|
BAROS_ROLE_BACK = 0,
|
|
|
|
BAROS_ROLE_HEAD,
|
|
|
|
BAROS_ROLE_ADMIN
|
|
|
|
} baros_role_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
const char *name;
|
|
|
|
baros_role_t role;
|
|
|
|
} baros_ble_cfg_t;
|
|
|
|
|
|
|
|
ESP_EVENT_DECLARE_BASE(EVENT_BAROS_BLE);
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
BAROS_BLE_DISC,
|
|
|
|
BAROS_BLE_CONNECT,
|
|
|
|
} baros_ble_event_t;
|
|
|
|
|
2024-12-02 01:58:29 -05:00
|
|
|
uint8_t baros_ble_init(baros_ble_cfg_t *cfg);
|
|
|
|
int baros_ble_scan_start();
|
|
|
|
int baros_ble_scan_stop();
|
2024-12-02 00:57:17 -05:00
|
|
|
|
2024-11-15 18:35:05 -05:00
|
|
|
#endif
|