You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(threading): add 200ms timeout to BleOpGuard on ESPHome main loop callers
Prevents NimBLE task starvation when the ESPHome main loop holds
ble_op_mutex_ during slow BLE stack operations. If the ESPHome loop
cannot acquire the lock within 200ms it logs a warning and returns
early; loop() will retry on the next iteration.
NimBLE GAP callback callers (handle_gap_enc_change, poll_irk_if_due,
retry_security_if_needed, handle_late_enc_timer) retain portMAX_DELAY
since dropping those events would lose IRK captures.
Changes:
- BleOpGuard gains optional timeout parameter (default: portMAX_DELAY)
- BleOpGuard::acquired() method for callers to check lock success
- start_advertising(), stop_advertising(), update_ble_name(),
refresh_mac() terminate, MAC rotation in loop(), and pairing timeout
terminate all use pdMS_TO_TICKS(200) with early-return on failure
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments