Files

3.4 KiB

TorqueVaultKMP

TorqueVaultKMP is a Kotlin Multiplatform (KMP) application designed for managing torque measurements, connecting to digital torque devices via Bluetooth Low Energy (BLE), and handling work orders.

The project targets Android and iOS using Compose Multiplatform for a shared UI and logic.

🚀 Key Features

  • BLE Device Management: Scan, connect, and bond with digital torque wrenches using the Kable library.
  • Adaptive Scanning: Automatically calibrates device discovery expiration by observing advertisement intervals, ensuring a responsive UI when devices stop broadcasting.
  • Work Order Workflow:
    • Fetch "Open" work orders from a remote API.
    • Synchronize work order details (License Plate, Make, Torque requirements) with connected BLE devices.
    • Receive and upload measurement results (Torque values, wheel/nut indices) back to the server.
  • Bonding & Persistence: Automatically remembers and auto-connects to bonded devices using SQLDelight for local storage.
  • Diagnostic Logging: A dedicated in-app logging system (LogRepository) that tracks system events, BLE communication, and HTTP requests. Supports exporting logs as CSV or Text for remote debugging.
  • Theme Support: Built-in support for Dark and Light modes.

🛠 Tech Stack

📁 Project Structure

  • composeApp/src/commonMain: Shared logic, UI, and data management.
    • screens/: UI modules for Scanner, Logs, Home, Settings, and Auth.
    • data/: Network DTOs, SQLDelight DB schema, and Repositories.
    • kable/: BLE abstraction and manager.
    • domain/: Business logic models and shared interfaces.
  • composeApp/src/androidMain: Android-specific implementations (e.g., Bluetooth permissions, Splash screen).
  • composeApp/src/iosMain: iOS-specific implementations (e.g., Native sharing sheets, CoreBluetooth delegates).
  • iosApp: Entry point for the iOS application.

🏗 Getting Started

Prerequisites

  • Android Studio (Ladybug or newer) / IntelliJ IDEA.
  • Xcode 15+ (for iOS development).
  • Kotlin Multiplatform plugin.

Build and Run

Android

./gradlew :composeApp:assembleDebug

iOS

Open the iosApp directory in Xcode or use the run configuration in Android Studio.

⚙️ Communication Protocol

The app uses a custom UART protocol to communicate with torque devices. Commands include:

  • START_WO: Initiate work order fetch.
  • ACCEPT_WO: Confirm a specific work order selection.
  • FINISH_WO: Send measurement data back to the app for server upload.

📜 Logging

Logs are stored in memory (up to 1000 entries) and categorized into System and Device logs. They can be shared via the Logs screen using platform-native sharing components.


Developed by Digitool Solutions.