Meshtastic-Android/conductor/archive/desktop_ble_kable_20260314/plan.md
James Rich 0b2e89c46f
refactor: Replace Nordic, use Kable backend for Desktop and Android with BLE support (#4818)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-16 23:06:43 +00:00

2.6 KiB

Implementation Plan: Desktop BLE Enablement via Kable

Phase 1: Define MeshtasticRadioProfile Abstraction [checkpoint: 1206e87]

  • Task: Define MeshtasticRadioProfile interface in core:ble/commonMain eaa623a
    • Write tests for expected profile behavior (e.g., state flow emission) using a simple fake
    • Implement MeshtasticRadioProfile interface, data classes for states, and configuration
  • Task: Conductor - User Manual Verification 'Phase 1: Define MeshtasticRadioProfile Abstraction' (Protocol in workflow.md) 1206e87

Phase 2: Refactor Nordic Implementation to use Abstraction [checkpoint: dc700a5]

  • Task: Implement MeshtasticRadioProfile in the existing Nordic implementation (androidMain) 83a8a9b
    • Write/adapt existing Android tests to verify MeshtasticRadioProfile adherence
    • Implement wrapper/adapter for Nordic classes to fulfill MeshtasticRadioProfile
  • Task: Decouple app-level BLE transport from Nordic types 2dfedde
    • Write tests to ensure BLE transport only relies on MeshtasticRadioProfile
    • Refactor transport layer (e.g., NordicBleInterface usages) to use the new profile interface
  • Task: Conductor - User Manual Verification 'Phase 2: Refactor Nordic Implementation to use Abstraction' (Protocol in workflow.md) dc700a5

Phase 3: Implement Kable Backend for Desktop [checkpoint: ed2a459]

  • Task: Setup Kable dependencies for jvmMain in core:ble b152eff
    • Update build.gradle.kts to include Kable dependency for Desktop
  • Task: Implement Kable MeshtasticRadioProfile backend (jvmMain) fa5cc82
    • Write commonMain unit tests with Kable fakes to verify scanning, connection, and read/write operations
    • Implement Kable scanning logic
    • Implement Kable connection and characteristic management
    • Implement Kable read/write data transfer logic
  • Task: Conductor - User Manual Verification 'Phase 3: Implement Kable Backend for Desktop' (Protocol in workflow.md) ed2a459

Phase 4: Integration and Final Testing [checkpoint: af6d3b3]

  • Task: Integrate Kable backend into Desktop app DI graph 28afcad
    • Wire up the Kable implementation in desktop module DI
  • Task: End-to-end verification 84aae75
    • Verify Android app still compiles and connects using Nordic
    • Verify Desktop app compiles and connects using Kable
  • Task: Conductor - User Manual Verification 'Phase 4: Integration and Final Testing' (Protocol in workflow.md) af6d3b3

Phase: Review Fixes

  • Task: Apply review suggestions b36da82