Button Press System

The button press system in ASG Client handles physical button interactions on the smart glasses.

How It Works

  1. The user presses the camera button on the glasses.
  2. The BES microcontroller classifies the press and sends a K900 command:
    • cs_pho for short press
    • cs_vdo for long press
    • newer firmware can also report hs_ntfy with "button click" or "button long click"
  3. K900CommandHandler forwards every button press to the phone as a button_press event.
  4. ASG Client decides whether to also capture locally using the gallery/save-mode gate.

Button Press Event

Every camera-button press is forwarded to the phone when Bluetooth is connected:
{
  "type": "button_press",
  "buttonId": "camera",
  "pressType": "short",
  "timestamp": 1234567890
}
pressType is "short" or "long". Apps can react to this event even when the glasses also capture locally.

Local Capture Gate

There is no separate “photo mode” versus “video mode” button configuration. Whether the button also captures locally is controlled by save_in_gallery_mode, persisted in AsgSettings.isSaveInGalleryMode().
  • When gallery/save mode is active, button presses capture locally.
  • When gallery/save mode is inactive and the glasses are connected, button presses are only forwarded to the phone/apps.
  • When the glasses are disconnected, button presses still capture locally so the press is not lost.

Short Press

If a video is currently recording, short press stops the recording. Otherwise, short press takes a photo using the persisted photo settings. Settings used:
  • button_photo_setting: photo size, one of small, medium, or large
  • button_camera_led: whether to use the privacy LED during capture

Long Press

If a video is currently recording, long press stops the recording. Otherwise, long press starts video recording after the battery check. Settings used:
  • button_video_recording_setting: width, height, and fps
  • button_max_recording_time: automatic stop timeout
  • button_camera_led: whether to use the privacy LED during recording

Other Button Commands

Besides the camera button, ASG Client also handles:
  • Swipe gestures from arm swipes
  • Battery status updates
  • Hotspot control commands

Troubleshooting

  1. Check logs for cs_pho, cs_vdo, or hs_ntfy.
  2. Confirm button_press is forwarded over BLE when connected.
  3. Verify save_in_gallery_mode if local capture is unexpectedly enabled or disabled.
  4. Confirm camera and storage permissions if local capture fails.