RokidGlassesClient

Rokid implementation of GlassesClient.

Internals:

  • Bluetooth: scan -> initBluetooth() -> connectBluetooth()

  • Wi‑Fi P2P: initWifiP2P() is required before syncSingleFile()

  • Photo: takeGlassPhoto() returns remote path -> syncSingleFile() gives local absolute path -> readBytes()

Notes:

  • This SDK does NOT request runtime permissions; the host app must handle permissions.

  • CXR-M v1.0.4 requires an SN authorization file (.lc) + developer clientSecret to connect.

Constructors

Link copied to clipboard
constructor(activity: AppCompatActivity, options: RokidGlassesClient.RokidOptions = RokidOptions())

Types

Link copied to clipboard
data class RokidAuthorization(val snLc: ByteArray, val clientSecret: String)

CXR-M v1.0.4 Bluetooth connect requires:

Link copied to clipboard
data class RokidOptions(val connectTimeoutMs: Long, val defaultWidth: Int = 2400, val defaultHeight: Int = 1800, val defaultJpegQuality: Int = 90, val authorization: RokidGlassesClient.RokidAuthorization? = null)

Properties

Link copied to clipboard
open override val capabilities: DeviceCapabilities
Link copied to clipboard
Link copied to clipboard
open override val events: Flow<GlassesEvent>
Link copied to clipboard
open override val model: GlassesModel
Link copied to clipboard
open override val state: StateFlow<ConnectionState>

Functions

Link copied to clipboard
open suspend override fun capturePhoto(options: CaptureOptions): Result<CapturedImage>
Link copied to clipboard
suspend override fun connect(): Result<Unit>
Link copied to clipboard
open suspend override fun disconnect()
Link copied to clipboard
open suspend override fun display(text: String, options: DisplayOptions): Result<Unit>
Link copied to clipboard
open suspend fun displayImage(image: DisplayImage, options: DisplayImageOptions): Result<Unit>
Link copied to clipboard
open suspend override fun playAudio(source: AudioSource, options: PlayAudioOptions): Result<Unit>
Link copied to clipboard
open suspend override fun startMicrophone(options: MicrophoneOptions): Result<MicrophoneSession>
Link copied to clipboard