ADC Home > Reference Library > Reference > Hardware & Drivers > Bluetooth > Bluetooth Framework Reference

 


IOBluetoothRFCOMMAudioController

Inherits from:

NSObject

Declared In:

Overview

Baseclass for various SCO profiles



Methods

-closeDeviceConnection

Close the bluetooth device connection

-closeRFCOMMChannel

Close the rfcomm channel

-closeSCOConnection

Close the SCO connection

-getAudioDeviceID

Get the audio device ID this object is attached to

-getBluetoothDevice

Get the bluetooth device associated with this device

-getIncomingRFCOMMChannelID

Access to the RFCOMM ID as specified on init for incoming device connections

-getOutgoingRFCOMMChannelID

Access to the RFCOMM ID as specified in the SDP of the device for outgoing connections

-initForConnectionToDevice:delegate:

Create a new IOBluetoothRFCOMMAudioController for outgoing connect to a device

-initWithIncomingDevice:incomingRFCOMMChannelID:delegate:

Create a new IOBluetoothRFCOMMAudioController for a device that is trying to connect in

-isDeviceConnected

Get the connection state of the bluetooth device being used

-isRFCOMMChannelOpen

Check if the RFCOMM channel is open

-isSCOConnected

Check if the SCO connection is open

-openDeviceConnection

Open the bluetooth device connection

-openRFCOMMChannel

Open rfcomm channel on current bluetooth device on the outgoing RFCOMM channel ID

-openSCOConnection

Open the SCO connection

-sendRFCOMMData:length:

Send RFCOMM data to the device

-setRFCOMMChannel:

Set the RFCOMM channel to use


closeDeviceConnection


Close the bluetooth device connection

- (IOReturn) closeDeviceConnection; 
Return Value

The result of the first stage of disconnection, kIOReturnNoDevice if no device.

Discussion

Look for final result in the provided delegate method


closeRFCOMMChannel


Close the rfcomm channel

- (IOReturn) closeRFCOMMChannel; 
Return Value

Result will be value returned from the channels' "closeChannel" method, kIOReturnNotAttached if no channel is set

Discussion

Look for final results in the provided delegate method


closeSCOConnection


Close the SCO connection

- (IOReturn) closeSCOConnection; 
Return Value

kIOReturnSuccess on success or if already closed, various errors if failed

Discussion

Look for final results in the provided delegate method


getAudioDeviceID


Get the audio device ID this object is attached to

- (AudioDeviceID) getAudioDeviceID; 
Return Value

The audio device ID this object is attached to, NULL if not attached


getBluetoothDevice


Get the bluetooth device associated with this device

- (IOBluetoothDevice *) getBluetoothDevice; 
Return Value

The bluetooth device this object is using, otherwise NULL


getIncomingRFCOMMChannelID


Access to the RFCOMM ID as specified on init for incoming device connections

- (BluetoothRFCOMMChannelID) getIncomingRFCOMMChannelID; 
Return Value

The RFCOMM channel ID of the remote device, 0 if none


getOutgoingRFCOMMChannelID


Access to the RFCOMM ID as specified in the SDP of the device for outgoing connections

- (BluetoothRFCOMMChannelID) getOutgoingRFCOMMChannelID; 
Return Value

The RFCOMM channel ID of the remote device, 0 if none


initForConnectionToDevice:delegate:


Create a new IOBluetoothRFCOMMAudioController for outgoing connect to a device

- (id) initForConnectionToDevice: (IOBluetoothDevice *)device delegate: (id)inDelegate; 
Parameters
device

A valid IOBluetoothDevice

inDelegate

An object to act as delegate

Return Value

A newly created IOBluetoothRFCOMMAudioController object on success, nil on failure

Discussion

Typically you won't be calling this method directly, instead you'll use methods provided by the subclasses.


initWithIncomingDevice:incomingRFCOMMChannelID:delegate:


Create a new IOBluetoothRFCOMMAudioController for a device that is trying to connect in

- (id) initWithIncomingDevice: (IOBluetoothDevice *)device incomingRFCOMMChannelID: (BluetoothRFCOMMChannelID)incomingRFCOMMChannelID delegate: (id)inDelegate; 
Parameters
device

A valid IOBluetoothDevice with baseband connection

incomingRFCOMMChannelID

The RFCOMM ID the device is trying to connect to

inDelegate

An object to act as delegate

Return Value

A newly created IOBluetoothRFCOMMAudioController object on success, nil on failure

Discussion

Typically you won't be calling this method directly, instead you'll use methods provided by the subclasses.


isDeviceConnected


Get the connection state of the bluetooth device being used

- (BOOL) isDeviceConnected; 
Return Value

The connection state of the device, FALSE if no device or not connected


isRFCOMMChannelOpen


Check if the RFCOMM channel is open

- (BOOL) isRFCOMMChannelOpen; 
Return Value

TRUE if open, FALSE if closed or device is nil


isSCOConnected


Check if the SCO connection is open

- (BOOL) isSCOConnected; 
Return Value

TRUE if open, FALSE if closed or device is nil


openDeviceConnection


Open the bluetooth device connection

- (IOReturn) openDeviceConnection; 
Return Value

The result of the first stage of connection, kIOReturnNoDevice if no device.

Discussion

Look for final result in the provided delegate method


openRFCOMMChannel


Open rfcomm channel on current bluetooth device on the outgoing RFCOMM channel ID

- (IOReturn) openRFCOMMChannel; 
Return Value

Result will be value returned from IOBluetoothDevice openRFCOMMChannelAsync if device is valid, kIOReturnError if no device is set

Discussion

Look for final result in the provided delegate method


openSCOConnection


Open the SCO connection

- (IOReturn) openSCOConnection; 
Return Value

kIOReturnSuccess on success or if still open, various errors if failed

Discussion

Look for final result in the provided delegate method


sendRFCOMMData:length:


Send RFCOMM data to the device

- (IOReturn) sendRFCOMMData:(const void *)data length:(UInt16)length; 
Parameters
data

Data to be sent to device

length

Length of the data

Return Value

Result will be value returned from the channels' "writeAsync" method, kIOReturnNotAttached if no channel is set


setRFCOMMChannel:


Set the RFCOMM channel to use

- (void) setRFCOMMChannel:(IOBluetoothRFCOMMChannel *)rfcommChannel; 
Parameters
rfcommChannel

The channel to use or nil to release the current one


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.

 

Last Updated: 2008-08-07