DeviceSearchTask
@available(*, deprecated, message: "DeviceSearchTask has been replaced by ConnectionTask.")
public class DeviceSearchTask
The DeviceSearchTask class encapsulates the device search functionality. It requires a DeviceSearchUserInterface object that gets called to show and update the device picker which allows users to select a discovered device. The DeviceSearchUserInterface calls back into the DeviceSearchTask via the DeviceSearchUserInterfaceDelegate protocol.
-
Creates a new device search task. This initializer sets
selfas thedelegateproperty on theuserInterfaceobject.Declaration
Swift
public init(bluetoothManager: BluetoothManager = BoseWearableLib.shared.bluetoothManager, removeTimeout: TimeInterval = 15, mode: DeviceSearchMode, userInterface: DeviceSearchTaskUserInterface, completionHandler: @escaping (CancellableResult<WearableDeviceSession>) -> Void)Parameters
bluetoothManagerthe Bluetooth manager used to perform the device search
removeTimeoutthe timeout value passed to
BluetoothManager.startScanning(removeAfter:)modethe search mode
userInterfacethe user interface object used to display and select discovered devices
completionHandlerthe callback to receive the result of the device search task
-
Starts the task.
Declaration
Swift
public func start()
-
Declaration
Swift
public func selected(device: DiscoveredDevice) -
Declaration
Swift
public func cancelled()
DeviceSearchTask Class Reference