BluetoothCollector

public class BluetoothCollector : DeviceCollector, @unchecked Sendable

Collector for Bluetooth Low Energy (BLE) capability information.

This collector determines whether the device supports Bluetooth Low Energy by checking the CoreBluetooth framework’s central manager state. It provides information about BLE support without requiring location permissions.

  • Declaration

    Swift

    public typealias DataType = BluetoothInfo
  • key

    Unique identifier for bluetooth capability data

    Declaration

    Swift

    public let key: String
  • collect() Asynchronous

    Collects Bluetooth capability information

    Declaration

    Swift

    public func collect() async -> BluetoothInfo?

    Return Value

    BluetoothInfo containing support status

  • Initializes a new instance with optional state provider (for testing)

    Declaration

    Swift

    public init(stateProvider: BluetoothStateProvider? = nil)

    Parameters

    stateProvider

    Custom state provider. If nil, uses real CoreBluetooth implementation