-
Notifications
You must be signed in to change notification settings - Fork 0
Core Device Info Overview
Welcome to the Device Info documentation for the AIBuds SDK. This section covers reading the device's current information and reported capabilities, adapting to its physical controls, synchronizing or setting its time, reading and changing its language, and requesting the latest storage and media-count information.
Browse the generated Wiki navigation for the pages in this section.
To interact with device information, follow these steps:
- Connect to Device - Establish a connection with your AIBuds device
-
Check Protocol Conformance - Verify the device conforms to
DeviceInfoAPIprotocol - Read or Update Information - Read the available properties directly, or call the appropriate method when information must be refreshed or changed
- Device Details: Read the properties currently exposed by the device, including its identity, firmware, connection state, battery status, device capabilities, hardware configuration, current and supported languages, call status, storage and media state, recording-duration support, AI capabilities, and co-processor model
- Time Management: Synchronize the device with the current time or set a specific time
-
Language Settings: Read the current language from
languageSetting, inspectsupportedLanguages, and set a supportedDeviceLanguagevalue -
Storage Information: Request the latest storage information, then read used and free space in megabytes from
storageInfo -
Media Count: Request the latest media information, then read photo, video, and audio counts from
mediaCountInfo
Base identity and connection properties are available through DeviceConvertible. Additional Device Info properties and methods are exposed through DeviceInfoAPI. Before using those additional capabilities, verify that the device conforms to the protocol:
```swift
guard let device = device as? DeviceInfoAPI else {
print("Device does not support DeviceInfoAPI")
return
}
```
```objc
id<AIBudsDeviceInfoAPI> device = (id<AIBudsDeviceInfoAPI>)self.device;
if (![device conformsToProtocol:@protocol(AIBudsDeviceInfoAPI)]) {
NSLog(@"Device does not support AIBudsDeviceInfoAPI");
return;
}
```
-
Check Protocol Conformance: Always verify the device supports the
DeviceInfoAPIprotocol before calling methods - Handle Errors: Implement proper error handling in completion handlers
-
Background Execution: Wrap UI updates in
DispatchQueue.main.asyncwhen updating from completion handlers -
Use Weak Self When Needed: Use
[weak self]when a completion handler captures its owning object and could otherwise create a retain cycle -
Read Refreshed Properties After Success: After a storage or media-count request succeeds, read the updated
storageInfoormediaCountInfoproperty -
Use Reported Capabilities: Gate optional features with
deviceCapabilities; treatnilas not-yet-known, and usehardwareConfigurationto adapt instructions and controls to the fitted hardware
- Device information may vary depending on the device model and firmware version
- Some devices may not support all features described in this section
- Check protocol conformance, device-reported capability values, device model, and firmware before exposing a feature in your application
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