-
Notifications
You must be signed in to change notification settings - Fork 0
Core Wear Detection Overview
Mr.P edited this page Aug 29, 2026
·
2 revisions
Wear Detection exposes the device's capability, enabled state, and current left/right wear state. Devices that report a configurable capability can also enable or disable detection through the SDK.
Browse the generated Wiki navigation for the pages in this section.
- Connect to the Device - Wait until the device is connected and ready.
-
Check Protocol Conformance - Verify support for
DeviceWearDetectionAPI. -
Read the Capability - Use
wearDetectionCapabilityto determine whether detection is supported and configurable. -
Read the Current State - Use
isWearDetectionEnabledandwearStatus. -
Configure When Supported - Call
setWearDetection(enabled:completion:)only for a configurable device.
WearDetectionCapability distinguishes three levels:
| Value | Meaning |
|---|---|
.none |
Wear detection is not supported. |
.supportedNotConfigurable |
Wear detection is supported, but its enabled state cannot be changed through this API. |
.supportedAndConfigurable |
Wear detection is supported and can be enabled or disabled. |
-
isWearDetectionEnabledreports whether detection is currently enabled. -
WearStatusreports unknown, not wearing, left-only, right-only, or both-ear state. - Capability, enabled state, and wear state are separate values; do not infer one from another.
Wear Detection is accessed through DeviceWearDetectionAPI:
guard let device = device as? DeviceWearDetectionAPI else {
print("Device does not support DeviceWearDetectionAPI")
return
}id<AIBudsDeviceWearDetectionAPI> device = (id<AIBudsDeviceWearDetectionAPI>)self.device;
if (![device conformsToProtocol:@protocol(AIBudsDeviceWearDetectionAPI)]) {
NSLog(@"Device does not support AIBudsDeviceWearDetectionAPI");
return;
}-
Check Capability Before Configuration: Only
.supportedAndConfigurableauthorizes changing the enabled state. - Use Current Properties: Read the SDK's current snapshots rather than calling invented query methods.
-
Observe Changes: Use
DeviceDelegatecallbacks for enabled-state and wear-state changes. -
Treat Unknown Explicitly: Keep
.unknowndistinct from.notWearing.
- An enum case existing in the SDK does not guarantee that every device supports that capability.
- The SDK does not promise automatic playback behavior when wear state changes; application behavior should be based on product requirements.
- The SDK Demo reads capability and enabled state from
DeviceWearDetectionAPIand only presents configuration when the capability is configurable.
AIBuds SDK documentation · Full documentation · API Reference
- Introduction
- Getting Started
- Core Concepts
-
Core Features
- Basic Features
- Device Info
- Find Device
- Physical Operations
- Work Mode
- Work Status
- Wear Detection
- Volume Control
- Music Control
- TWS
- Equalizer
- ANC
- Audio
- Camera
- Remote Camera
- File Import
- Teleprompter
- Segment Navigation
- Live Streaming
- Device Applications
- OTA
- Camera OTA
- Service Auth
- AI Services
- Voice Assistant
- Logging
- Advanced Topics
- Releases
- Troubleshooting