Skip to main content

Work Status Overview

Welcome to the Work Status documentation for the AIBuds SDK. This section covers APIs for monitoring the device's current operational status, providing real-time information about what the device is doing.

Available Features

Implement with AI Assistance

Build with AI

Implement this workflow with AI

Use the official Manage AIBuds Work State and Mode skill to adapt this workflow to your app.

Read and follow https://docs-aibuds.github.io/skills/manage-aibuds-work-state-and-mode. Use it to implement Manage AIBuds Work State and Mode in this iOS project and verify the result.
View official skill

Getting Started

To monitor work status, follow these steps:

  1. Connect to Device - Establish a connection with your AIBuds device
  2. Check Protocol Conformance - Verify the device conforms to DeviceWorkStateAPI protocol
  3. Get Status - Read the current workState property
  4. Listen for Changes - Implement device(_:didWorkStateChanged:) on the device delegate

Key Concepts

Work Status States

See Work States for the complete WorkState reference. The values are grouped as:

  • Connection and Idle: Waiting for connection, connected idle, or disconnected idle
  • Playback and Communication: Local music playback, phone calls, or AI conversation
  • Capture and Transfer: Photo capture, video/audio recording, file transfer, or streaming
  • Maintenance: Factory reset, OTA upgrade, shutdown, or device test states

Protocol Reference

Work status functionality is accessed through the DeviceWorkStateAPI protocol:

Swift
guard let device = device as? DeviceWorkStateAPI else {
    print("Device does not support DeviceWorkStateAPI")
    return
}

Best Practices

  1. Check Protocol Conformance: Always verify the device supports the DeviceWorkStateAPI protocol
  2. Monitor Status: Use the device delegate callback to update UI when the state changes
  3. Handle State Transitions: Respond appropriately when the device changes state
  4. Avoid Conflicts: Don't initiate operations that conflict with the current state

Notes

  • Work status provides real-time information about device activity
  • Work-state changes can be reported through the optional device delegate callback
  • Some states may prevent certain operations from being performed