Developer preview
SDK reference
Explore illustrative Android and iOS API patterns. Expand an operation to view a proposed native signature.
Requests, events and tasks
| Signal | Meaning |
|---|---|
| Request ID | Identifies a call; await its documented result or failure event. |
| Completed / data event | Interpret according to the operation. Stopping a recording can be acknowledged before its file finishes saving. |
| TaskStarted | A long operation has been accepted locally; store taskID and keep listening. |
| TaskProgress | Intermediate progress. A percentage alone does not establish completion. |
| TaskFinished | Inspect the task’s terminal outcome: success, failure, cancellation, or unknown. |
Register one event handler and retain the client on the main thread. Do not associate every incoming event with the most recent button tap. Unsolicited notifications can use request ID 0.
Native integration examples
// Import path and client names are illustrative and subject to change.
// Create and retain one client, on the main thread.
val sdk = ArmorDeviceClient(context.applicationContext)
sdk.onEvent = { event ->
when (event) {
is ArmorEvent.Discovered -> showDevice(event.device)
is ArmorEvent.Connection -> {
if (event.state == "ready") sdk.readBattery()
}
is ArmorEvent.Battery -> showBattery(event.percent)
is ArmorEvent.Failure ->
showError(event.error.code, event.error.operation)
else -> Unit
}
}
// After runtime permission approval:
sdk.startScan()
// When the user selects a discovered device:
// sdk.connect(deviceID = selectedDeviceID)
// On owner teardown, call sdk.close().// Import path and client names are illustrative and subject to change.
// Create and retain one client, on the main thread.
let sdk = ArmorDeviceClient()
sdk.onEvent = { event in
switch event {
case .discovered(let device): showDevice(device)
case .battery(_, let percent): showBattery(percent)
case .failure(let error): showError(error.code, error.operation)
default: break
}
}
// Wait for Bluetooth availability, then scan.
sdk.startScan()
// When the user selects a discovered device:
// sdk.connect(deviceID: selectedDeviceID)
// After .connection("ready"), request sdk.readBattery().
// On owner teardown, call sdk.close().Base APIs
startScan()Planned API
Explicit scan; case-insensitive name filter.
fun startScan(nameContains: String = "")func startScan(nameContains: String = "")stopScan()Planned API
Stop scanning.
fun stopScan()func stopScan()connect()Planned API
Use a local scan ID; pass an app-stored expectedSerial to verify a historical target. Ready follows protocol, model and nonempty serial validation; a mismatch reports IDENTITY_MISMATCH and disconnects. Auto-reconnect defaults off; when enabled it retries only this selection up to 5 times after 1/2/4/8/16 seconds. Disconnect an existing selection first.
fun connect(deviceID: String, autoReconnect: Boolean = false, expectedSerial: String? = null)func connect(deviceID: String, autoReconnect: Bool = false, expectedSerial: String? = nil)disconnect()Planned API
Disconnect and stop retries for the selected device; outstanding requests fail.
fun disconnect()func disconnect()readInfo()Planned API
After ready, use InfoKey for protocol/model, serial, hardware or chip versions; KM is Pro only.
fun readInfo(key: InfoKey): Longfunc readInfo(key: InfoKey) -> UInt32readBattery()Planned API
Read battery after ready.
fun readBattery(): Longfunc readBattery() -> UInt32readDeviceState()Planned API
Read power/charging/wear after ready.
fun readDeviceState(): Longfunc readDeviceState() -> UInt32playLocator()Planned API
Trigger one fixed short locator tone after ready.
fun playLocator(): Longfunc playLocator() -> UInt32close()Planned API
Idempotent release; create a new client for further use.
fun close()func close()EQ
readEqPresets()Planned API
Read the actual preset list; never invent IDs.
Result: EqPresets
fun readEqPresets(): Longfunc readEqPresets() -> UInt32readEqState()Planned API
Read EQ availability and the current preset ID.
Result: EqState
fun readEqState(): Longfunc readEqState() -> UInt32selectEqPreset()Planned API
ID must occur in the actual list; confirm selection by readback.
Result: EqState
fun selectEqPreset(presetID: Int): Longfunc selectEqPreset(presetID: Int) -> UInt32readEqCurve()Planned API
Read only the currently selected curve; never switch presets. Explicitly select the target with selectEqPreset first.
Result: EqCurveRead
fun readEqCurve(): Longfunc readEqCurve() -> UInt32writeEqCurve()Planned API
Write only the selected 63/64, which must match expectedPresetID; never switch implicitly. Five finite gains, quantized to 1/60 dB, written together and read back.
Result: EqCurveRead
fun writeEqCurve(expectedPresetID: Int, gainsDb: List<Double>): Longfunc writeEqCurve(expectedPresetID: Int, gainsDb: [Double]) -> UInt32Connection and settings
setAutoReconnect()Planned API
Control bounded disconnect retries for this client's selected device only; off by default. Disabling cancels retries without disconnecting. disconnect/close stop retries; no cross-launch restoration.
Result: Completed
fun setAutoReconnect(enabled: Boolean): Longfunc setAutoReconnect(enabled: Bool) -> UInt32readConnectionDetails()Planned API
Does not require ready; returns actual known control, pairing, and audio-input state.
Target result: ConnectionDetails
fun readConnectionDetails(): Longfunc readConnectionDetails() -> UInt32readCapabilities()Planned API
Requires ready; reports which capabilities apply to a model and are supported by the SDK release.
Target result: Capabilities
fun readCapabilities(): Longfunc readCapabilities() -> UInt32readName()Planned API
Requires ready; read the display or advertised name separately.
Target result: Name
fun readName(kind: NameKind): Longfunc readName(kind: NameKind) -> UInt32setName()Planned API
Requires ready; 1–32 UTF-8 bytes, without truncation. Display name applies immediately; broadcast name applies on the next advertising cycle.
Target result: Completed
fun setName(kind: NameKind, name: String): Longfunc setName(kind: NameKind, name: String) -> UInt32readGameMode()Planned API
Requires ready; read the actual low-latency switch.
Target result: GameMode
fun readGameMode(): Longfunc readGameMode() -> UInt32setGameMode()Planned API
Requires ready; update the local value only after device acknowledgement.
Target result: Completed
fun setGameMode(enabled: Boolean): Longfunc setGameMode(enabled: Bool) -> UInt32readLanguage()Planned API
Requires ready; read the device prompt language.
Target result: Language
fun readLanguage(): Longfunc readLanguage() -> UInt32setLanguage()Planned API
Requires ready; EN/ES/FR/DE only; does not change the app UI language.
Target result: Completed
fun setLanguage(language: DeviceLanguage): Longfunc setLanguage(language: DeviceLanguage) -> UInt32factoryReset()Planned API
Requires ready and no recording/transfer/update; the app obtains user confirmation first. Success means only that the device accepted reset.
Target result: Completed
fun factoryReset(): Longfunc factoryReset() -> UInt32readLed()Planned API
Requires ready and the LED model; read decorative LED settings.
Target result: Led
fun readLed(): Longfunc readLed() -> UInt32setLed()Planned API
Requires ready and the LED model; only existing product steps/modes are allowed; recording indicators are unaffected.
Target result: Completed
fun setLed(settings: LedSettings): Longfunc setLed(settings: LedSettings) -> UInt32Voice notes
startVoiceNote()Planned API
Requires ready, microphone permission, onPcm, and no other SDK audio task; SDK assigns noteID=taskID.
Target result: TaskStarted
fun startVoiceNote(): Longfunc startVoiceNote() -> UInt32stopVoiceNote()Planned API
Stop capture and drain SDK PCM callbacks, then request app file finalization; not final save success.
Target result: Completed
fun stopVoiceNote(noteID: Long): Longfunc stopVoiceNote(noteID: UInt32) -> UInt32finishVoiceNote()Planned API
Call only after FinalizationRequired to report the actual file-save outcome; the local session can still finalize after disconnection.
Target result: Completed
fun finishVoiceNote(noteID: Long, result: NoteSaveResult): Longfunc finishVoiceNote(noteID: UInt32, result: NoteSaveResult) -> UInt32readVoiceNoteState()Planned API
Requires ready; query current/latest device note and local session state.
Target result: VoiceNote
fun readVoiceNoteState(): Longfunc readVoiceNoteState() -> UInt32Camera
takePhoto()Planned API
Requires Pro, ready, and idle camera/AP/update resources; taskID is the nonzero actionID.
Target result: TaskStarted
fun takePhoto(): Longfunc takePhoto() -> UInt32startVideo()Planned API
Same prerequisites as photo capture; no duration parameter; runs until stopped or ended by the device.
Target result: TaskStarted
fun startVideo(): Longfunc startVideo() -> UInt32stopVideo()Planned API
Nonzero selects the current SDK recording; 0 means the current device-initiated recording only. Success means stop accepted; file finalization may continue.
Target result: Completed
fun stopVideo(actionID: Long): Longfunc stopVideo(actionID: UInt32) -> UInt32readCameraState()Planned API
Requires Pro and ready; returns current/latest capture state.
Target result: Camera
fun readCameraState(): Longfunc readCameraState() -> UInt32Media
openMediaSession()Planned API
Requires Pro, ready, and no capture/update; a reusable media session remains after the task succeeds.
Target result: TaskStarted
fun openMediaSession(joinMode: WifiJoinMode = WifiJoinMode.SYSTEM_ASSISTED): Longfunc openMediaSession(joinMode: WifiJoinMode = .systemAssisted) -> UInt32continueWifiJoin()Planned API
After manual joining, trigger actual supported network readiness; success means the check was submitted, then wait for the original task.
Target result: Completed
fun continueWifiJoin(taskID: Long): Longfunc continueWifiJoin(taskID: UInt32) -> UInt32closeMediaSession()Planned API
Finish/cancel downloads and deletions first; close the transfer session; do not force the phone onto another network.
Target result: Completed
fun closeMediaSession(sessionID: Long): Longfunc closeMediaSession(sessionID: UInt32) -> UInt32readMediaSession()Planned API
Requires Pro and ready; query network and media-session readiness.
Target result: MediaSession
fun readMediaSession(): Longfunc readMediaSession() -> UInt32listMedia()Planned API
Requires a ready media session; enumerate completed files and return category counts.
Target result: MediaList
fun listMedia(sessionID: Long, category: MediaCategory = MediaCategory.ALL): Longfunc listMedia(sessionID: UInt32, category: MediaCategory = .all) -> UInt32readStorage()Planned API
Requires Pro and control ready; a network connection is not required.
Target result: Storage
fun readStorage(): Longfunc readStorage() -> UInt32downloadMedia()Planned API
The app supplies a nonempty device-file list and writable directory. The SDK manages only this transfer and partial files, verifies and returns them; no gallery import, archiving, synchronization or automatic deletion.
Target result: TaskStarted
fun downloadMedia(sessionID: Long, files: List<MediaFile>, directory: String): Longfunc downloadMedia(sessionID: UInt32, files: [MediaFile], directory: URL) -> UInt32resumeMediaDownload()Planned API
The app supplies recovery data and the writable directory containing partial files. Verify device, remote identity and local partial content before starting a new task; reject mismatches.
Target result: TaskStarted
fun resumeMediaDownload(recovery: RecoveryData, sessionID: Long, directory: String): Longfunc resumeMediaDownload(recovery: RecoveryData, sessionID: UInt32, directory: URL) -> UInt32deleteMedia()Planned API
The app must explicitly pass true to confirm durable save/sync of these exact files; no default confirmation. No receipts or app-database access. Verify device/file identity before deletion and reconcile uncertain outcomes.
Target result: TaskStarted
fun deleteMedia(sessionID: Long, files: List<MediaFile>, syncConfirmed: Boolean): Longfunc deleteMedia(sessionID: UInt32, files: [MediaFile], syncConfirmed: Bool) -> UInt32Firmware update
startFirmwareUpdate()Planned API
Recheck all conditions and start the selected chip only; the app supplies the local package; KM uses the selected join mode.
Target result: TaskStarted
fun startFirmwareUpdate(target: FirmwareTarget, packageFile: String, manifest: FirmwareManifest, joinMode: WifiJoinMode = WifiJoinMode.SYSTEM_ASSISTED): Longfunc startFirmwareUpdate(target: FirmwareTarget, packageFile: URL, manifest: FirmwareManifest, joinMode: WifiJoinMode = .systemAssisted) -> UInt32readFirmwareUpdateState()Planned API
Requires a live client; query native state/actual versions when reachable, otherwise return a local record explicitly marked unknown; never treat cache as a fresh device query.
Target result: FirmwareUpdate
fun readFirmwareUpdateState(target: FirmwareTarget): Longfunc readFirmwareUpdateState(target: FirmwareTarget) -> UInt32resumeFirmwareUpdate()Planned API
The app returns recovery data, the same native package and manifest. Query actual state before native-supported recovery; never blindly reinstall or read a hidden task store.
Target result: TaskStarted
fun resumeFirmwareUpdate(recovery: RecoveryData, packageFile: String, manifest: FirmwareManifest, joinMode: WifiJoinMode = WifiJoinMode.SYSTEM_ASSISTED): Longfunc resumeFirmwareUpdate(recovery: RecoveryData, packageFile: URL, manifest: FirmwareManifest, joinMode: WifiJoinMode = .systemAssisted) -> UInt32validateFirmwarePackage()Planned API
Requires control ready and complete information; validate local package/model/hardware/current pair/order without starting an update.
Target result: FirmwareValidated
fun validateFirmwarePackage(target: FirmwareTarget, packageFile: String, manifest: FirmwareManifest): Longfunc validateFirmwarePackage(target: FirmwareTarget, packageFile: URL, manifest: FirmwareManifest) -> UInt32Logs
configureLogging()Planned API
Configure this client's onLog output to the app. No log files, database, rotation or ZIP; device logs are unaffected.
Result: Completed
fun configureLogging(configuration: LogConfiguration): Longfunc configureLogging(configuration: LogConfiguration) -> UInt32exportDeviceLogs()Planned API
Requires ready; model support will be stated in the SDK documentation; read firmware-exposed wireless logs and verify integrity.
Target result: TaskStarted
fun exportDeviceLogs(target: FirmwareTarget, directory: String): Longfunc exportDeviceLogs(target: FirmwareTarget, directory: URL) -> UInt32Tasks
cancelTask()Planned API
Request task cancellation under the task-specific rules. Success means cancellation took effect; the task also emits its terminal event.
Target result: Completed
fun cancelTask(taskID: Long): Longfunc cancelTask(taskID: UInt32) -> UInt32Error handling
Handle errors using the types and guidance documented for the SDK release. Design the app to distinguish retryable failures, final failures and uncertain outcomes, and reconcile device state before repeating actions with side effects.
Packages and source
SDK packages, examples and distribution terms will be announced through Lucyd’s developer channels. SDK packages, usage terms and final API names will be announced through Lucyd’s developer channels.