# 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

- [DeviceLinkerManager.kt](https://gitee.com/as_pixar/glass3sdkdemo/blob/main/glass3sdkphonedemo/app/src/main/java/com/rokid/phone/DeviceLinkerManager.kt)
- [MainPhoneActivity.kt](https://gitee.com/as_pixar/glass3sdkdemo/blob/main/glass3sdkphonedemo/app/src/main/java/com/rokid/phone/ui/MainPhoneActivity.kt)
- [SettingActivity.kt](https://gitee.com/as_pixar/glass3sdkdemo/blob/main/glass3sdkphonedemo/app/src/main/java/com/rokid/phone/SettingActivity.kt)

## 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.  
