Skip to content

[Accessories] 2 - Save and reconnect accessories #477

Description

@KacperKozak

Parent

#475

What to build

Show saved accessories and native connection status in the Accessories section of the Board selector. Tapping a row opens accessory configuration; preserve existing Board selection behavior. Accessories remain independent of individual Board rows.

Add explicit enrollment and native saved identity, then launch auto-connect and fresh-session restoration with visible connection state on the accessory screen. Include request IDs, applied acknowledgements, retry/lease mechanics and capability revalidation as observable session behavior. No dependency on JS liveness. Exercise a state-only accessory peer to verify app command expiry before light-specific rendering exists.

Type: AFK. Complexity: high. Blocked by: 1. Stories: 2–5, 18, 25.

Likely files

  • src/modules/board/components/BoardSelectorSheet.tsx — existing selector content and sheet; preserve Board behavior.

  • src/screens/main/overlays/TopBar.tsx — current selector caller and cross-domain composition starting point.

  • src/screens/showcase/board/BoardSelectorSheetShowcase.tsx — update the selector preview for the new section and state.

  • modules/vescape-core/android/src/main/java/expo/modules/vescapecore/service/AutoConnectProvider.kt — process launch entry.

  • modules/vescape-core/android/src/main/java/expo/modules/vescapecore/service/CoreForegroundService.kt — native lifetime.

  • modules/vescape-core/ios/connection/VescapeLaunchSubscriber.swift — iOS launch/restoration.

  • modules/vescape-core/ios/connection/BoardSessionController.swift — existing lifecycle integration.

  • modules/vescape-core/android/src/main/java/expo/modules/vescapecore/telemetry/TelemetryDatabase.kt — existing native storage facade; inspect before choosing durable representation.

  • modules/vescape-core/ios/telemetry/TelemetryDatabase.swift — peer storage facade.

  • src/modules/hardware/store/hardwareStore.ts — PR Vescape Sensors: BLE link to the ESP32 sensor module #441 presentation mirror starting point.

  • vescape-accessories: src/main.cpp — session reset and volatile runtime ownership.

Implementation hints

  • Compose the Board and accessory domains at screen level. Do not add hardware-domain imports to Board components; extract composition if needed and update the selector showcase.

  • The parent PRD includes the complete protocol and product-design snapshots. Local docs may not yet exist on the implementation branch; materialize them from the parent when needed.

  • PR Vescape Sensors: BLE link to the ESP32 sensor module #441 is prior art at commit 91ebeaf0fdf3daa8a8151314048de9e663b9149c; paths marked PR Vescape Sensors: BLE link to the ESP32 sensor module #441 are absent from the planning checkout.

  • Paths prefixed vescape-accessories: belong to vescape-app/vescape-accessories. Coordinate both repositories for firmware/app protocol changes.

  • Keep native Android/iOS contracts aligned with parity links. Reuse native lifecycle and storage contracts; JS renders state and sends intents.

Acceptance criteria

  • Show saved accessories and native connection status in the Accessories section of the Board selector. Tapping a row opens accessory configuration; preserve existing Board selection behavior. Accessories remain independent of individual Board rows.

  • unknown nearby devices are never auto-enrolled.

  • reboot preserves saved identity.

  • changed names do not duplicate hardware.

  • new sessions discard old queues.

  • disconnected/failed sessions are shown accurately.

  • state-only peers demonstrate expiry.

  • persistent changes have migration/restore coverage where applicable.

Blocked by

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:accessoriesAccessory discovery, protocol, configuration, and Board bindingsarea:dbTouches database / persistent storagearea:nativeTouches native side (modules/vesc-ble, Swift/Kotlin)complexity:highCritical paths, subtle correctness, native pipelines. Use opus.enhancementNew feature or requestready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions