Skip to content

Device status sync & remote control

Purpose

Show how the phone ships JSON-style text messages over classic Bluetooth to poll system telemetry (version, IDs, battery) and adjust brightness/volume/other knobs on the glasses.

Entry points

Phone home → MainPhoneActivity
Settings lane → SettingActivity
Shared linkage helper → DeviceLinkerManager

Platforms

  • Phone (sender)
  • Glasses (responder via demo protocol)

Main files

Flow

  1. Phone calls sendTextMessageByClassicBT() with a business payload.
  2. Frames wrap CustomMessage + typed ProjectBusinessType intents.
  3. Glass parses/executes, then replies via the same Bluetooth channel.
  4. Phone messageListener unpacks payloads for firmware version, device ID, battery %, brightness, volume, ring state, …
  5. UI layers re-render from aggregated state.

Reference commands

  • GET_SYSTEM_INFO
  • POWER_UPDATE
  • SET_BRIGHTNESS
  • SET_VOLUME
  • SEND_CONFIG
  • SET_ZOOM_CAMERA

Notes for developers

Why textual JSON payloads

Tiny control verbs map cleanly to structured JSON payloads that are trivial to extend and trivial to grep in logs.

Extensibility

Typically three edits:

  1. Add a enum entry to ProjectBusinessType.
  2. Extend CustomMessage.
  3. Mirror send + handle paths on glass + phone.

Caveats

  • This wire format is project-local, not a stock SDK semantic layer.
  • Keep fields backward-compatible as you iterate.
  • Brightness/volume sliders on home demand an active Bluetooth session.