mirror of
https://github.com/torlando-tech/pyxis.git
synced 2026-03-29 05:19:50 +00:00
After a 574 connection failure, the NimBLE controller's scan state can become corrupted (returning rc=530 / Invalid HCI Params) even after the host re-syncs. This led to scan failure escalation and device reboots. Key fixes: - Add ble_gap_conn_cancel() to enterErrorRecovery() — stuck GAP master connection operations were blocking all subsequent scans - Add ble_hs_sched_reset(BLE_HS_ECONTROLLER) in error recovery to force a full host-controller resynchronization after desync - Proactively cancel stale GAP connections before scan start - Reduce SCAN_FAIL_RECOVERY_THRESHOLD from 10 to 5 for faster recovery - Enhanced scan failure logging with GAP state diagnostics - Move ESP reset reason logging after WiFi init for UDP log visibility - Suppress connection candidate log spam when at max connections Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>