fix: handle expected BLE disconnect after SaveConfig #3
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "schwifty/fix-saveconfig-disconnect"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
The DX-Smart CP28 beacon reboots after receiving
SaveConfig(0x60) to persist config to flash. This drops the BLE connection before the write callback fires, causing the app to report "Unexpected disconnect" even though provisioning succeeded.Fix
In
didDisconnectPeripheral, check if we're on the last command (SaveConfig) when disconnect occurs. If so, callsucceed()instead offail().Root cause analysis
Credit to @luna for tracing the full flow — the Android stack handles this gracefully via coroutine timeout, but the iOS delegate-based BLE stack was treating all mid-write disconnects as failures.
Test plan