1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-06 21:32:21 +01:00

BLE loop use (#1882)

This commit is contained in:
Jesse Hills
2021-06-10 14:04:39 +12:00
committed by GitHub
parent ea0127e42b
commit 99d90845b5
14 changed files with 272 additions and 165 deletions

View File

@@ -23,17 +23,14 @@ typedef struct {
class ESP32BLE : public Component {
public:
void setup() override;
// void loop() override;
void loop() override;
void dump_config() override;
float get_setup_priority() const override;
void mark_failed() override;
bool can_proceed() override;
bool has_server() { return this->server_ != nullptr; }
bool has_client() { return false; }
bool is_ready() { return this->ready_; }
void set_server(BLEServer *server) { this->server_ = server; }
protected:
@@ -45,10 +42,7 @@ class ESP32BLE : public Component {
void real_gattc_event_handler_(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param);
void real_gap_event_handler_(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param);
static void ble_core_task_(void *params);
static bool ble_setup_();
bool ready_{false};
bool ble_setup_();
BLEServer *server_{nullptr};
Queue<BLEEvent> ble_events_;