mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-01 18:48:28 +02:00
Refactor esp32_ble_tracker to use esp32_ble core ble setup code (#4173)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "ble_service.h"
|
||||
#include "ble_characteristic.h"
|
||||
|
||||
#include "esphome/components/esp32_ble/ble.h"
|
||||
#include "esphome/components/esp32_ble/ble_advertising.h"
|
||||
#include "esphome/components/esp32_ble/ble_uuid.h"
|
||||
#include "esphome/components/esp32_ble/queue.h"
|
||||
@@ -32,7 +33,7 @@ class BLEServiceComponent {
|
||||
virtual void stop();
|
||||
};
|
||||
|
||||
class BLEServer : public Component {
|
||||
class BLEServer : public Component, public GATTsEventHandler, public Parented<ESP32BLE> {
|
||||
public:
|
||||
void setup() override;
|
||||
void loop() override;
|
||||
@@ -55,7 +56,8 @@ class BLEServer : public Component {
|
||||
uint32_t get_connected_client_count() { return this->connected_clients_; }
|
||||
const std::map<uint16_t, void *> &get_clients() { return this->clients_; }
|
||||
|
||||
void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param);
|
||||
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 register_service_component(BLEServiceComponent *component) { this->service_components_.push_back(component); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user