Capabilities and compatibility
Check runtime, permissions, and host conditions. Distinguish public APIs, runtime support, and physical-device behavior.
Check these three layers before calling an API#
- C plugins check Host ABI, struct_size, GM_PLUGIN_CAP_*, and actual function pointers. Check extension-table versions and sizes separately.
- Web plugins first await gm.ready(), then query gm.runtime.getCapabilities(). Determine available features from the manifest, user authorization, methods, events, and message channels.
- Check connection, runtime state, and actual call results on the target App and glasses. Permission granted, Bluetooth connected, and business operation completed are distinct conditions.
Display capabilities and hardware specifications#
See “Hardware specifications” for canvas dimensions, GRAY_4, display levels, and nominal refresh information. Still check capability bits, function tables, and display_get_info results during integration.
Input, IMU and device state#
“Hardware specifications” covers primary/navigation actions, raw IMU fields, battery, charging, wear state, and language APIs. Actual values depend on the target device and enabled mode.
Capabilities accessed through phone Web APIs#
| Capability | PhoneSDK entry point | Permissions and boundaries |
|---|---|---|
| Glasses pages and images | Page, text, image and frame API for gm.display. | display; executed through the App and glasses bridge GMP, not by direct driver access. |
| Connection and events | gm.device.getInfo()、subscribeEvents / unsubscribeEvents。 | device.info, device.events; Subscription type includes button, imuGesture, rawImu, and connection. |
| Custom GMP Message | gm.plugin.sendMessage()、gm.plugin.onMessage()。 | device.messaging channels; your two components implement protocol encoding, business acknowledgments, and deduplication. |
| Configuration storage | gm.storage.get / set / remove / clear。 | storage; suitable for small application settings. It does not expose a persistent GMP filesystem. |
| User Selected Files | gm.files.pick / list / stat / openRead / delete / getUsage。 | files.user-selected; use host-managed fileId values and streams. Do not guess absolute phone paths. |
| Audio capture and recording | gm.audio.openCapture()、gm.audio.openRecording()。 | audio.capture; the phone host manages input paths, authorization, concurrency, and background behavior. The GMP core table provides no raw Mic / Speaker PCM. |
| Audio playback | Standard Web media playback with audio.playback permission. | This does not imply a gm.audio.play() or general TTS API. Follow the actual Web examples. |
| Foreground location | gm.location.getCurrentPosition / watchPosition / clearWatch。 | location.foreground; system location permission and foreground-state requirements still apply. |
| Networking and your own AI services | Web network requests such as fetch. | network; Handle CORS, authentication and business keys on the server. Do not access the network directly from GMP. |
Capabilities without a public API#
- gm_plugin.h provides no persistent plugin KV, arbitrary Flash access, firmware upgrade, factory calibration, or power-control API.
- IMU temperature_raw is a raw value. The current API has no service converting it into device thermal state.
- The public Host and PhoneSDK method tables currently provide no system context-menu registration, glasses-camera API, or general large-model API.
- There is no public GMP API to select array microphones or disable low-level audio processing. Start with PhoneSDK capture and media examples.
What the simulator covers and what still needs device testing#
| Scenario | Check in Studio first | Continue on physical devices |
|---|---|---|
| Text, Images and Games | Layout, protocols, input mapping, stop, and restart. | Readability while worn, actual refresh behavior, continuous input, resource use, and power consumption. |
| IMU and display control | Input logic, state synchronization, and errors. | Actual sampling, gesture response, brightness, display power, and recovery. |
| Audio, file, location | Business workflows and simulated API branches. | System permissions, input devices, file pickers, screen lock, and cancellation. |
| Cross-device messages | Encoding on both sides, request IDs, and reply handling. | Actual Bluetooth disconnection, reconnection, transfer latency, and either side exiting. |
Reference files in the toolkit#
- GlassSDK/include/gm_plugin.h
- GlassSDK/include/gm_plugin_lvgl_api.h
- GlassSDK/docs/CAPABILITY_MATRIX.md
- PhoneSDK/packages/web-sdk/src/index.d.ts
- PhoneSDK/packages/bridge-contract/src/permission-policy.js
- PhoneSDK/examples/display-control-lab/README.md
- PhoneSDK/examples/audio-capture-lab/README.md