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
Work States
Interpret every WorkState value reported by a device
Get Work Status
Read the current work state of an AIBuds device
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.Getting Started
To monitor work status, follow these steps:
- Connect to Device - Establish a connection with your AIBuds device
- Check Protocol Conformance - Verify the device conforms to
DeviceWorkStateAPIprotocol - Get Status - Read the current
workStateproperty - 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
- Objective-C
guard let device = device as? DeviceWorkStateAPI else {
print("Device does not support DeviceWorkStateAPI")
return
}id<AIBudsDeviceWorkStateAPI> device = (id<AIBudsDeviceWorkStateAPI>)self.device;
if (![device conformsToProtocol:@protocol(AIBudsDeviceWorkStateAPI)]) {
NSLog(@"Device does not support AIBudsDeviceWorkStateAPI");
return;
}Best Practices
- Check Protocol Conformance: Always verify the device supports the
DeviceWorkStateAPIprotocol - Monitor Status: Use the device delegate callback to update UI when the state changes
- Handle State Transitions: Respond appropriately when the device changes state
- 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