mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-05-12 00:28:20 -04:00
Wires core flows to the meshtastic-sdk (0.1.0-SNAPSHOT) while keeping the legacy path alive. Goal: prove the SDK works with a real Android app and surface API deficiencies. Build: - settings.gradle.kts: composite build inclusion for meshtastic-sdk (../meshtastic-sdk) with dependency substitution for all SDK artifacts - libs.versions.toml: sdk = "0.1.0-SNAPSHOT", mavenCentral snapshots repo - app/build.gradle.kts: sdk-core, sdk-proto, sdk-transport-ble, sdk-storage-sqldelight dependencies Bootstrap: - MeshUtilApplication: AndroidContextHolder.context set in onCreate() before startKoin so SqlDelightStorageProvider can locate app files - RadioClientProvider (@Single, binds SdkClientLifecycle): mutex-serialized rebuildAndConnect(), strips 'x' prefix from BLE devAddr, holds RadioClient StateFlow - RadioClientViewModel: exposes RadioClientProvider to UI layer SDK ViewModels (POC quality, compile-verified): - SdkNodeListViewModel: NodeChange.Snapshot/Added/Updated/Removed → UiNode - SdkMessagingViewModel: sendText() via client.sendText(), incomingText via client.textMessages (Gap B — now fixed in SDK) - SdkConfigViewModel: configBundle reads, setConfig/setOwner writes, loadChannels() via admin, Gap G workaround (local override map) - SdkTelemetryViewModel: TelemetryApi.observe(NodeId), requestDeviceMetrics Service lifecycle: - SdkClientLifecycle interface in core:service (avoids reverse dep from service → app); RadioClientProvider implements it - MeshService.onDestroy: calls sdkClientLifecycle.disconnect() before serviceJob.cancel() - BlePeripheralFactory.kt in core:ble: public buildPeripheralForAddress() wrapper (Gap F workaround; proper fix needed in SDK transport-ble) SDK gaps discovered and logged: Gap B - textMessages flow (FIXED in SDK feat/meshtastic-android-integration-gaps) Gap C - channels StateFlow (no reactive cache, only admin.listChannels()) Gap F - BleTransport MAC string factory (requires live Peripheral today) Gap G - configBundle not refreshed after editSettings writes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>