IOBluetoothDevicePair

Inherits from:
Declared In:

Overview

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

Discussion

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 cannot be stopped or cancelled. You can set the delegate to nil to stop receiving messages, but the process will continue behind the scenes until success or failure occurs. This is due to the complex interaction between the all the Bluetooth software components and your code.



Methods

-device

Get the IOBluetoothDevice being used by the object.

+pairWithDevice:

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

-replyPINCode:

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

-replyPINCode:PINCode:

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

-replyUserConfirmation:

This is the required reply to the devicePairingUserConfirmationRequest delegate message.

-setDelegate:

Set the delegate object. It is not retained.

-setDevice:

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

-start

Kicks off the pairing with the device.


device


Get the IOBluetoothDevice being used by the object.

- (IOBluetoothDevice*)device; 
Return Value

device The IOBluetoothDevice object that the IOBluetoothDevicePair object is pairing with, as specified in -setDevice: or pairWithDevice:


pairWithDevice:


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

+ (IOBluetoothDevicePair *)pairWithDevice:(IOBluetoothDevice*)device; 
Parameters
device

An IOBluetoothDevice to attept to pair with. The device is retained.

Return Value

Returns an IOReturn or Bluetooth error code, if the pairing could not be started.


replyPINCode:


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

See Also:
- (void)replyPINCode:(ByteCount)PINCodeSize PINCode:(BluetoothPINCode *)PINCode; 
Parameters
PINCodeSize

The PIN code length in octets (8 bits).

PINcode

PIN code for the device. Can be up to a maximum of 128 bits.


replyPINCode:PINCode:


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

See Also:
- (void)replyPINCode:(ByteCount)PINCodeSize PINCode:(BluetoothPINCode *)PINCode; 
Parameters
PINCodeSize

The PIN code length in octets (8 bits).

PINcode

PIN code for the device. Can be up to a maximum of 128 bits.


replyUserConfirmation:


This is the required reply to the devicePairingUserConfirmationRequest delegate message.

- (void)replyUserConfirmation:(BOOL)reply; 
Parameters
reply

A yes/no answer provide by the user to the numeric comparison presented.


setDelegate:


Set the delegate object. It is not retained.

- (void)setDelegate:(id)delegate; 
Parameters
device

The IOBluetoothDevice object that the IOBluetoothDevicePair object with which to perform a pairing.


setDevice:


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

- (void)setDevice:(IOBluetoothDevice*)inDevice; 
Parameters
device

The IOBluetoothDevice object that the IOBluetoothDevicePair object with which to perform a pairing.


start


Kicks off the pairing with the device.

- (IOReturn)start; 
Return Value

Returns an IOReturn or Bluetooth error code, if the pairing could not be started.

 

Did this document help you? Yes It's good, but... Not helpful...

 

Last Updated: 2009-10-09