Contents

connectToLastConnectedPeripheral(timeout:callback:)

Attempts to reconnect the central manager to the most recently connected peripheral.

Declaration

func connectToLastConnectedPeripheral(timeout: TimeInterval = 7.0, callback: ((CBPeripheral?, Error?) -> Void)? = nil) -> Bool

Parameters

  • timeout:

    The amount of time, in seconds, before the connection attempt is aborted. If the timeout value is nil, the attempt won’t time out. To cancel a connection attempt, call the 3029469 Disconnect method.

  • callback:

    A function that’s called when the connection attempt succeeds or fails.

Return Value

A Boolean value indicating whether the currently active playground book has previously connected to a peripheral. If true, the central manager attempts to reconnect to it.

See Also

Connecting Peripherals