mirror of
https://github.com/esphome/esphome.git
synced 2026-09-11 07:17:33 +00:00
Apply advertising requests once BLE becomes active
A component that requests advertising during setup does so before the stack is up, so the request had no effect until something else restarted advertising. Refresh on the transition to active so early requests, and requests still held across a disable/enable cycle, take effect right away.
This commit is contained in:
@@ -592,6 +592,10 @@ void ESP32BLE::loop_handle_state_transition_not_active_() {
|
||||
}
|
||||
|
||||
this->state_ = BLE_COMPONENT_STATE_ACTIVE;
|
||||
#ifdef USE_ESP32_BLE_ADVERTISING
|
||||
// Requests made before the stack was up (or before it was re-enabled) take effect now
|
||||
this->advertising_refresh();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user