Skip to content

Core Tws Overview

Mr.P edited this page Aug 29, 2026 · 2 revisions

TWS Overview

The TWS API reports whether a device is a True Wireless Stereo device and whether its TWS connection is currently active.

Available Features

Browse the generated Wiki navigation for the pages in this section.

Getting Started

  1. Obtain a Device - Use a connected or discovered DeviceConvertible instance.
  2. Check Protocol Conformance - Verify support for DeviceTWSAPI.
  3. Read Device Type - Use isTws.
  4. Read Connection State - Use isTwsConnected and observe connection changes when needed.

Key Concepts

Device Type and Connection

  • isTws identifies whether the device is a TWS device.
  • isTwsConnected reports the current TWS connection snapshot.
  • A TWS device can currently be disconnected, so the two Boolean values are not interchangeable.

Protocol Reference

TWS information is exposed by DeviceTWSAPI:

Swift

guard let device = device as? DeviceTWSAPI else {
    print("Device does not expose TWS information")
    return
}

Objective-C

id<AIBudsDeviceTWSAPI> device = (id<AIBudsDeviceTWSAPI>)self.device;
if (![device conformsToProtocol:@protocol(AIBudsDeviceTWSAPI)]) {
    NSLog(@"Device does not expose TWS information");
    return;
}

Best Practices

  1. Check Protocol Conformance: There is no asynchronous TWS support query.
  2. Keep Values Separate: Do not treat a disconnected TWS device as a non-TWS device.
  3. Observe Connection Changes: Implement didTwsConnectionStatusChanged for live UI.

Notes

  • The public protocol does not initiate TWS pairing, connection, or disconnection.
  • The SDK does not define stereo routing or channel behavior through this API.

AIBuds SDK iOS Wiki

Clone this wiki locally