EUC BLE Library

Experimental Android BLE library for electric unicycles — work in progress

FR | EN

EUC BLE Library

Bluetooth Low Energy library for Electric Unicycles (EUC), providing an Android client API and manufacturer-specific protocol implementations.

GroupId: io.github.tritbool
ArtifactId: euc-ble-library
Modules: euc-ble-protocols + euc-ble-session + euc-ble-core (KMP), euc-ble-android (Android connector)
Upcoming version: 1.0.0

Work in progress. The upcoming 1.0.0 release is not a stability guarantee. Protocol support is incomplete; some features may be broken, vary by wheel or firmware, or change as the project evolves. Verify behavior on the exact device and firmware you plan to use. Unit tests and captured traffic do not replace physical-device testing.


Why this library?

The project provides:

Captured-frame tests are partial and do not imply complete model, firmware, or command coverage.


Client application

TuxWheel is the first client app built with this library. It is available as a pre-release, with publication on F-Droid planned.


Key features


Architecture at a glance

Current modules and proposed iOS extension

Sessions decide when; protocols decode and encode; the connector performs BLE I/O.

Client, session and protocol interactions, with platform and BLE extension points

Adding iOS: a proposed euc-ble-ios would provide a client API, platform-specific orchestration and a CoreBluetooth BleTransport. It could reuse the KMP core’s session drivers, protocols and policies, which already target iOS. Gold annotations show extension points, not implemented support. See the architecture overview for details and diagram sources.


Asynchrony & data flows

Example usage on the app side:

val client = EucBleClient(context)

client.setConnectionCallback(object : ConnectionCallback() {
    override fun onDeviceDiscovered(device: EUCDevice) {
        client.connect(device)
    }
})

client.setDataCallback(object : DataCallback {
    override fun onDataReceived(data: EUCData) {
        // process telemetry on an appropriate dispatcher
    }
})

client.setErrorCallback(object : ErrorCallback {
    override fun onError(error: BLEException) {
        // fine-grained error handling
    }
})

client.initialize()
client.startScan()

Test coverage & quality

Coverage and limitations

HTML coverage reports are published under:

(See the “Test coverage reports” section below.)

Test methodology

Tests include real BLE captures and constructed unit-test cases:

Additional tests cover selected command/polling contracts, frame reassembly, and emission frequency. They do not guarantee that all telemetry fields or commands behave consistently across protocols.


Test coverage reports

To make coverage visible:


Using it in an app

Maven Central dependency (upcoming 1.0.0)

dependencies {
    implementation("io.github.tritbool:euc-ble-library:1.0.0")
}

The dependency will be usable from Maven Central once version 1.0.0 has been published.

Android BLE permissions

Android BLE requires:

The library exposes structured errors via BLEException and ErrorCallback to handle these cases.


API documentation

The Pages workflow publishes the generated Dokka reference after main-branch quality checks complete or when run manually against a completed main-branch quality run.


Current limitations and next steps


Thanks to them


Contributing

Issues, PRs, and additional WheelLog captures (new wheels, new firmwares, tricky edge cases) are all welcome.
Repository: https://github.com/Tritbool/euc_ble_library.