Skip to content
SDK Docs
Discord Order Now

On the glasses

Device and media

Battery, clock, music controls, display power and audio levels.

These functions run locally on the glasses. They work without a phone connection and return right away.

Battery, clock and connection

device_status(out, capacity) fills a buffer of at least 10 bytes and returns 10, or -1 if the buffer is too small.

ByteValue
0Battery percent, 0 to 100. Anything else means unknown.
1Charging (1) or not (0)
2Classic Bluetooth (audio) connected
3Phone link connected
4Clock is set
5 to 9Hour (0 to 23), minute, month (1 to 12), day (1 to 31), weekday (Sunday is 0)

now_ms() returns a millisecond clock you can use for timing and animation.

Media

Show what’s playing and control it, straight from the glasses.

  • media_state(out, capacity) writes an available byte, a playing byte, then the title and artist as null-terminated UTF-8 (up to 80 bytes each, so use a 164-byte buffer). Nothing playing reads as [0, 0]. It returns the byte count, or -1 if the buffer is too small.
  • media_command(command) takes 0 previous, 1 play or pause, 2 next, 3 volume up, 4 volume down. It returns 1 when the command was sent, 0 if sending failed and -1 for an unknown command. Sent doesn’t guarantee the player acted on it.

Read media_state when your media screen opens and about every 250 ms while it’s visible. Shared/media.rs wraps both functions.

Display

FunctionDoes
display_brightness_get()Returns the current brightness in percent.
display_brightness_set(percent)Sets brightness from 0 to 100 right away and returns the value applied.
display_power_get()Returns 1 while the display is awake and 0 while it’s asleep.
display_power_set(on)1 wakes the display, or keeps it awake by resetting its idle timer. 0 puts it to sleep.

Audio levels

audio_level(channel) returns a loudness from 0 to 255, averaged over about 50 ms. Channel 0 is the glasses microphone and channel 1 is MIRA’s spoken replies. Readings older than 400 ms, and invalid channels, return 0.

Use it for meters and visualizers, and do your own smoothing. To work with the audio itself, see Microphone audio.