Class

IOBluetoothDevicePair

An instance of IOBluetoothDevicePair represents a pairing attempt to a remote Bluetooth device.

Declaration

class IOBluetoothDevicePair : NSObject

Overview

Use the IOBluetoothDevicePair object to attempt to pair with any Bluetooth device. Once -start is invoked on it, progress is returned to the delegate via the messages defined below. This object enables you to pair with devices within your application without having to use the standard panels provided by the IOBluetoothUI framework, allowing you to write custom UI to select devices, and still handle the ability to perform device pairings.

Of note is that this object MAY attempt to perform two low-level pairings, depending on the type of device you are attempting to pair. This is inconsequential to your code, however, as it occurs automatically and does not change the messaging.

Once started, the pairing can be stopped. This will set the delegate to nil and then attempt to disconnect from the device if already connected.

Topics

Initializers

init!(device: IOBluetoothDevice!)

Creates an autorelease IOBluetoothDevicePair object with a device as the pairing target.

Instance Properties

Instance Methods

func device() -> IOBluetoothDevice!

Get the IOBluetoothDevice being used by the object.

func replyPINCode(Int, pinCode: UnsafeMutablePointer<BluetoothPINCode>!)

This is the required reply to the devicePairingPINCodeRequest delegate message. Set the PIN code to use during pairing if required.

func replyUserConfirmation(Bool)

This is the required reply to the devicePairingUserConfirmationRequest delegate message.

func setDevice(IOBluetoothDevice!)

Set the device object to pair with. It is retained by the object.

func start() -> IOReturn

Kicks off the pairing with the device.

func stop()

Stops the current pairing. Removes the delegate and disconnects if device was connected.

Relationships

Inherits From

Conforms To