AsteroidOS Link - a Kotlin library for discovering and operating AsteroidOS smartwatches
This is a Kotlin library for remotely controlling AsteroidOS smartwatches and for scanning and discovering such smartwatches. It is written as a Kotlin Multiplatform library, and heavily uses Kotlin coroutines. A simple test Android app is provided for trying out the library and for debugging and development.
API overview
The main entrypoint is the Watches
class. Instances of that class are created using OS specific
versions of the getWatches
function. Watches
allows for scanning for smartwatches and provides
functionality for acquiring Watch
instances. This Watch
interface provides methods and Kotlin
State
and Shared
flows for getting notifications from the smartwatch. To synchronize the watch datetime,
kotlinx.datetime's LocalDateTime
class is used.
TODO
-
Screenshot requests cannot currently be aborted. This is a limitation of the AsteroidOS Screenshot Profile in its current form.
-
Android sometimes asks for pairing PINs more often than what should be necessary.
-
The Nordic BLE Library’s
createBondInsecure
has to be used instead ofensureBond
to reliably establish connections. -
Bluetooth errors during connection setup are currently not being handled fully and robustly.
-
The API documentation is KDoc compliant, but documentation files are not being generated. Integrate dokka for that purpose.