16 #include <esp_gap_ble_api.h> 17 #include <esp_gattc_api.h> 18 #include <esp_gatts_api.h> 55 virtual void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) = 0;
60 virtual void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
61 esp_ble_gattc_cb_param_t *param) = 0;
66 virtual void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if,
67 esp_ble_gatts_cb_param_t *param) = 0;
72 virtual void ble_before_disabled_event_handler() = 0;
82 void setup()
override;
84 void dump_config()
override;
85 float get_setup_priority()
const override;
87 void advertising_start();
88 void advertising_set_service_data(
const std::vector<uint8_t> &data);
89 void advertising_set_manufacturer_data(
const std::vector<uint8_t> &data);
90 void advertising_add_service_uuid(
ESPBTUUID uuid);
91 void advertising_remove_service_uuid(
ESPBTUUID uuid);
97 this->ble_status_event_handlers_.push_back(handler);
102 static void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param);
103 static void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param);
104 static void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param);
106 void real_gatts_event_handler_(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param);
107 void real_gattc_event_handler_(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param);
108 void real_gap_event_handler_(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param);
111 bool ble_dismantle_();
112 bool ble_pre_setup_();
113 void advertising_init_();
123 esp_ble_io_cap_t io_cap_{ESP_IO_CAP_NONE};
void play(Ts... x) override
uint64_t ble_addr_to_uint64(const esp_bd_addr_t address)
virtual void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param)=0
std::vector< GAPEventHandler * > gap_event_handlers_
std::vector< GATTcEventHandler * > gattc_event_handlers_
Queue< BLEEvent > ble_events_
std::vector< GATTsEventHandler * > gatts_event_handlers_
void register_gatts_event_handler(GATTsEventHandler *handler)
Base class for all automation conditions.
Nothing has been initialized yet.
void play(Ts... x) override
void register_ble_status_event_handler(BLEStatusEventHandler *handler)
std::vector< BLEStatusEventHandler * > ble_status_event_handlers_
bool check(Ts... x) override
void set_enable_on_boot(bool enable_on_boot)
void register_gap_event_handler(GAPEventHandler *handler)
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
BLE should be disabled on next loop.
void set_io_capability(IoCapability io_capability)
BLE should be enabled on next loop.
void register_gattc_event_handler(GATTcEventHandler *handler)
BLEAdvertising * advertising_