Only trigger ble_client on_connect after discovering services (#3710)

This commit is contained in:
buxtronix 2022-08-15 13:06:05 +10:00 committed by Jesse Hills
parent 0d0733dd94
commit fb8846bb45
No known key found for this signature in database
GPG Key ID: BEAAE804EFD8E83A

View File

@ -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();
}
} }
}; };