Goal
Make work-driven link management the primary connection model: queue/work drives connect; idle teardown when quiet; reconnect Approach B; PoweredOn await—not silent no-ops.
PRD: Architecture (Connection model), FR-1.2 (Approach B parts), FR-1.4, FR-1.5, FR-8.6, FR-11, FR-9.2 (idle/hold logging)
Depends on: Phase 1 (Peripheral handle) — connect APIs live on the handle
High-level requirements
- Work-driven connect: when work requires a link, auto-connect without Advanced
connect (full command queue may be stubbed until Phase 4; use an equivalent “work pending” / hold-for-work signal if commands are not yet present—implementation plan decides the interim hook, but product end-state is non-empty command queue).
- Idle disconnect: global config, default 5s, only when no pending work and no Advanced app hold (FR-1.5).
- Advanced app hold:
Peripheral.connect(autoReconnect:) / disconnect() suppress idle while held; rare; Advanced docs (FR-11.2).
- Approach B reconnect:
- Tier-0 on work-driven connects while linked; cancel on idle/intentional disconnect drops OS reconnect
- Tier-1 armed only while work pending (or hold with reconnect); disarmed when quiet
- Idle grace may allow one OS reconnect → re-cancel if still quiet
- PoweredOn (FR-1.4 / FR-8.6): scan/connect/work await usable radio; terminal states fail with typed errors; no silent scan no-op
- Single state machine for work-driven and Advanced connect (FR-11.4)
- Connection-state observation remains (FR-1.3.1 / FR-11.5)
Out of scope
- FR-10 discovery ready gate (Phase 3) — link restore/reconnect without GATT re-discover remains as today until Phase 3
- Full command queue / run-after-ready (Phase 4+)
Acceptance criteria
Sub-issues
Planning/execution breakdown lives in child issues.
Goal
Make work-driven link management the primary connection model: queue/work drives connect; idle teardown when quiet; reconnect Approach B; PoweredOn await—not silent no-ops.
PRD: Architecture (Connection model), FR-1.2 (Approach B parts), FR-1.4, FR-1.5, FR-8.6, FR-11, FR-9.2 (idle/hold logging)
Depends on: Phase 1 (
Peripheralhandle) — connect APIs live on the handleHigh-level requirements
connect(full command queue may be stubbed until Phase 4; use an equivalent “work pending” / hold-for-work signal if commands are not yet present—implementation plan decides the interim hook, but product end-state is non-empty command queue).Peripheral.connect(autoReconnect:)/disconnect()suppress idle while held; rare; Advanced docs (FR-11.2).Out of scope
Acceptance criteria
Sub-issues
Planning/execution breakdown lives in child issues.