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
self
as thedelegate
property on theuserInterface
object.Declaration
Swift
public init(bluetoothManager: BluetoothManager = BoseWearableLib.shared.bluetoothManager, removeTimeout: TimeInterval = 15, mode: DeviceSearchMode, userInterface: DeviceSearchTaskUserInterface, completionHandler: @escaping (CancellableResult<WearableDeviceSession>) -> Void)
Parameters
bluetoothManager
the Bluetooth manager used to perform the device search
removeTimeout
the timeout value passed to
BluetoothManager.startScanning(removeAfter:)
mode
the search mode
userInterface
the user interface object used to display and select discovered devices
completionHandler
the 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()