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
- Phone calls
sendTextMessageByClassicBT()with a business payload. - Frames wrap
CustomMessage+ typedProjectBusinessTypeintents. - Glass parses/executes, then replies via the same Bluetooth channel.
- Phone
messageListenerunpacks payloads for firmware version, device ID, battery %, brightness, volume, ring state, … - UI layers re-render from aggregated state.
Reference commands
GET_SYSTEM_INFOPOWER_UPDATESET_BRIGHTNESSSET_VOLUMESEND_CONFIGSET_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:
- Add a enum entry to
ProjectBusinessType. - Extend
CustomMessage. - 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.