fix: explicitly disconnect after writeConfig so beacon can reboot
After SaveConfig is sent, the DXSmartProvisioner.writeConfig() returns but never disconnects. The beacon MCU needs the BLE link dropped to finalize its save-and-reboot cycle. Without disconnect, the beacon stays connected and keeps flashing indefinitely. Added 200ms delay + explicit provisioner.disconnect() after writeConfig completes in the success path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
640bc32f92
commit
a08d3db893
1 changed files with 5 additions and 1 deletions
|
|
@ -698,7 +698,11 @@ struct ScanView: View {
|
|||
|
||||
try await provisioner.writeConfig(config)
|
||||
writesCompleted = true
|
||||
// No explicit disconnect needed — succeed() already disconnects
|
||||
|
||||
// Give the beacon 200ms to process SaveConfig before dropping the BLE link.
|
||||
// The beacon MCU needs the connection terminated to finalize its reboot/save cycle.
|
||||
try? await Task.sleep(nanoseconds: 200_000_000)
|
||||
provisioner.disconnect()
|
||||
|
||||
try await APIClient.shared.registerBeaconHardware(
|
||||
businessId: business.id,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue