Meshtastic-Android/conductor/archive/android_kable_migration_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

3.4 KiB

Implementation Plan: Replace Nordic with Kable on Android (Deduplication Pass)

Phase 1: Deduplicate Kable Abstractions into commonMain [checkpoint: 709f6e3]

  • Task: Extract common Kable state mapping logic from jvmMain to commonMain 10cdd16
    • Create commonMain tests for BleConnectionState mapping using Kable State
    • Move KableMeshtasticRadioProfile and KableBleConnection logic that doesn't depend on platform specifics to commonMain
  • Task: Implement common Kable Scanner and Peripheral wrappers 2691d70
    • Extract generic connection lifecycle (connect, reconnect, close) to commonMain using Kable's Peripheral interface
  • Task: Conductor - User Manual Verification 'Phase 1: Deduplicate Kable Abstractions into commonMain' (Protocol in workflow.md) 709f6e3

Phase 2: Implement Kable Backend for Android (androidMain) [checkpoint: 12217de]

  • Task: Add Kable dependency to Android source set in core:ble/build.gradle.kts 011d619
  • Task: Implement Android-specific BleConnectionFactory and BleScanner using the deduplicated commonMain logic 589ee93
    • Write failing integration tests for Android Kable scanner (using fakes/mocks)
    • Implement KableBleScanner for androidMain
    • Write failing integration tests for Android Kable connection (using fakes/mocks)
    • Implement KableBleConnection for androidMain (handling Android-specific MTU requests if necessary)
  • Task: Conductor - User Manual Verification 'Phase 2: Implement Kable Backend for Android' (Protocol in workflow.md) 12217de

Phase 3: Migrate OTA Firmware Update Logic [checkpoint: 663c8e2]

  • Task: Deprecate NordicDfuHandler and replace with Kable-based DFU 06fe4f5
    • Write failing tests for Kable DFU integration
    • Implement new DFU handler in feature:firmware using MeshtasticRadioProfile / Kable abstraction
  • Task: Conductor - User Manual Verification 'Phase 3: Migrate OTA Firmware Update Logic' (Protocol in workflow.md) 663c8e2

Phase 4: Wire Kable into Android App and Remove Nordic [checkpoint: ebe1617]

  • Task: Deprecate and remove NordicBleInterface and AndroidBleConnection ebe1617
    • Remove NordicAndroidCommonLibraries and NordicDfuLibrary from gradle/libs.versions.toml and build files
    • Delete NordicBleInterface.kt and associated Nordic-specific radio implementations
  • Task: Wire new androidMain Kable implementation into the Koin DI graph ebe1617
    • Update AndroidRadioControllerImpl or DI modules to provide the new Kable BleConnectionFactory and BleScanner
  • Task: Conductor - User Manual Verification 'Phase 4: Wire Kable into Android App and Remove Nordic' (Protocol in workflow.md) ebe1617

Phase 5: Final Testing and Integration [checkpoint: 4778c0e]

  • Task: Update Android app UI tests and BLE unit tests to use Kable fakes 4778c0e
    • Fix any failing tests related to the Nordic removal
  • Task: Manual end-to-end verification 4778c0e
    • Build and run the Android app, verify BLE scanning, connecting, and messaging
    • Verify OTA updates work via BLE
    • Verify the Desktop app still functions correctly
  • Task: Conductor - User Manual Verification 'Phase 5: Final Testing and Integration' (Protocol in workflow.md) 4778c0e

Phase: Review Fixes

  • Task: Apply review suggestions e5dffd9