GlassesClient

interface GlassesClient

A minimal, unified API for AI glasses.

Design goals:

  • Keep app developers on a stable API surface

  • Hide transport differences (Frame BLE messages vs Rokid Wi‑Fi P2P sync)

  • Provide observability via state + events

Inheritors

Properties

Link copied to clipboard
Link copied to clipboard
abstract val events: Flow<GlassesEvent>

Non-fatal events (logs, warnings, tap events, etc.).

Link copied to clipboard
abstract val model: GlassesModel
Link copied to clipboard
abstract val state: StateFlow<ConnectionState>

Connection lifecycle state.

Functions

Link copied to clipboard
abstract suspend fun capturePhoto(options: CaptureOptions = CaptureOptions()): Result<CapturedImage>

Capture a photo and return JPEG bytes (plus metadata when available).

Link copied to clipboard
abstract suspend fun connect(): Result<Unit>

Establish connection to the glasses (and any required side-channels like Wi‑Fi P2P).

Link copied to clipboard
abstract suspend fun disconnect()

Tear down connection and release resources. Safe to call multiple times.

Link copied to clipboard
abstract suspend fun display(text: String, options: DisplayOptions = DisplayOptions()): Result<Unit>

Display text on the glasses.

Link copied to clipboard
open suspend fun displayImage(image: DisplayImage, options: DisplayImageOptions = DisplayImageOptions()): Result<Unit>

Display an encoded PNG/JPEG image on the glasses.

Link copied to clipboard
abstract suspend fun playAudio(source: AudioSource, options: PlayAudioOptions = PlayAudioOptions()): Result<Unit>

Play audio on the glasses.

Link copied to clipboard
abstract suspend fun startMicrophone(options: MicrophoneOptions = MicrophoneOptions()): Result<MicrophoneSession>

Start microphone capture and return a session that streams audio chunks.

Link copied to clipboard
open suspend fun startVideoStream(options: VideoStreamOptions = VideoStreamOptions()): Result<VideoStreamSession>

Start camera frame streaming and return a session that emits video frames.