mirror of
https://github.com/torlando-tech/pyxis.git
synced 2026-05-24 16:15:18 +00:00
BLE stability: host-controller resync, stuck GAP conn cancel, scan diagnostics
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>
This commit is contained in:
@@ -931,10 +931,10 @@ void BLEInterface::processDiscoveredPeers() {
|
||||
last_peer_log = now;
|
||||
}
|
||||
|
||||
if (candidate && candidate->mac_address.size() >= Limits::MAC_SIZE) {
|
||||
if (candidate && candidate->mac_address.size() >= Limits::MAC_SIZE &&
|
||||
_peer_manager.canAcceptConnection()) {
|
||||
INFO("BLE: Connection candidate: " + BLEAddress(candidate->mac_address.data()).toString() +
|
||||
" type=" + std::to_string(candidate->address_type) +
|
||||
" canAccept=" + std::string(_peer_manager.canAcceptConnection() ? "yes" : "no"));
|
||||
" type=" + std::to_string(candidate->address_type));
|
||||
}
|
||||
|
||||
if (candidate && _peer_manager.canAcceptConnection()) {
|
||||
|
||||
Reference in New Issue
Block a user