14#include <unordered_map>
19#include <esp_gatts_api.h>
22namespace esp32_ble_server {
24using namespace esp32_ble;
25using namespace bytebuffer;
29 void setup()
override;
54 esp_ble_gatts_cb_param_t *param)
override;
59 void on_connect(std::function<
void(uint16_t)> &&callback) {
96 uint16_t
clients_[USE_ESP32_BLE_MAX_CONNECTIONS]{};
Helper class to easily give an object a parent of type T.
std::vector< CallbackEntry > callbacks_
esp_gatt_if_t get_gatts_if()
void ble_before_disabled_event_handler() override
uint32_t get_connected_client_count()
const uint16_t * get_clients() const
std::vector< uint8_t > manufacturer_data_
void set_device_information_service(BLEService *service)
BLEService * device_information_service_
void set_manufacturer_data(const std::vector< uint8_t > &data)
void remove_client_(uint16_t conn_id)
float get_setup_priority() const override
enum esphome::esp32_ble_server::BLEServer::State INIT
uint8_t get_client_count() const
void dump_config() override
void dispatch_callbacks_(CallbackType type, uint16_t conn_id)
bool can_proceed() override
BLEService * get_service(ESPBTUUID uuid, uint8_t inst_id=0)
std::vector< BLEService * > services_to_start_
void enqueue_start_service(BLEService *service)
BLEService * create_service(ESPBTUUID uuid, bool advertise=false, uint16_t num_handles=15)
void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param) override
void remove_service(ESPBTUUID uuid, uint8_t inst_id=0)
void add_client_(uint16_t conn_id)
std::vector< ServiceEntry > services_
uint16_t clients_[USE_ESP32_BLE_MAX_CONNECTIONS]
void restart_advertising_()
int8_t find_client_index_(uint16_t conn_id) const
void on_connect(std::function< void(uint16_t)> &&callback)
void on_disconnect(std::function< void(uint16_t)> &&callback)
BLEServer * global_ble_server
Providing packet encoding functions for exchanging data with a remote host.
std::function< void(uint16_t)> callback