mirror of
https://github.com/esphome/esphome.git
synced 2025-10-07 12:23:47 +01:00
Merge branch 'esp32_ble_server_early_bail' into integration
This commit is contained in:
@@ -125,26 +125,25 @@ bool BLECharacteristic::is_created() {
|
|||||||
if (this->state_ != CREATING_DEPENDENTS)
|
if (this->state_ != CREATING_DEPENDENTS)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
bool created = true;
|
|
||||||
for (auto *descriptor : this->descriptors_) {
|
for (auto *descriptor : this->descriptors_) {
|
||||||
created &= descriptor->is_created();
|
if (!descriptor->is_created())
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
if (created)
|
|
||||||
this->state_ = CREATED;
|
this->state_ = CREATED;
|
||||||
return this->state_ == CREATED;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BLECharacteristic::is_failed() {
|
bool BLECharacteristic::is_failed() {
|
||||||
if (this->state_ == FAILED)
|
if (this->state_ == FAILED)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
bool failed = false;
|
|
||||||
for (auto *descriptor : this->descriptors_) {
|
for (auto *descriptor : this->descriptors_) {
|
||||||
failed |= descriptor->is_failed();
|
if (descriptor->is_failed()) {
|
||||||
}
|
|
||||||
if (failed)
|
|
||||||
this->state_ = FAILED;
|
this->state_ = FAILED;
|
||||||
return this->state_ == FAILED;
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BLECharacteristic::set_property_bit_(esp_gatt_char_prop_t bit, bool value) {
|
void BLECharacteristic::set_property_bit_(esp_gatt_char_prop_t bit, bool value) {
|
||||||
|
Reference in New Issue
Block a user