mirror of
https://github.com/esphome/esphome.git
synced 2024-11-07 09:31:10 +01:00
Only trigger ble_client on_connect after discovering services (#3710)
This commit is contained in:
parent
0d0733dd94
commit
fb8846bb45
@ -15,10 +15,10 @@ class BLEClientConnectTrigger : public Trigger<>, public BLEClientNode {
|
|||||||
void loop() override {}
|
void loop() override {}
|
||||||
void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
|
void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
|
||||||
esp_ble_gattc_cb_param_t *param) override {
|
esp_ble_gattc_cb_param_t *param) override {
|
||||||
if (event == ESP_GATTC_OPEN_EVT && param->open.status == ESP_GATT_OK)
|
if (event == ESP_GATTC_SEARCH_CMPL_EVT) {
|
||||||
this->trigger();
|
|
||||||
if (event == ESP_GATTC_SEARCH_CMPL_EVT)
|
|
||||||
this->node_state = espbt::ClientState::ESTABLISHED;
|
this->node_state = espbt::ClientState::ESTABLISHED;
|
||||||
|
this->trigger();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user