\xA0


OBEXBluetooth.h

Overview

Object Exchange over Bluetooth.



Functions

IOBluetoothOBEXSessionCreateWithIncomingIOBluetoothRFCOMMChannel

Create an OBEX session with an IOBluetoothRFCOMMchannel. This implies you are creating a OBEX SERVER session that will dole out info to remote Bluetooth clients.

IOBluetoothOBEXSessionCreateWithIOBluetoothDeviceRefAndChannelNumber

Create an OBEX session with a device ref and an RFCOMM channel ID. This allows you to bypass the browser if you already know the SDP information.

IOBluetoothOBEXSessionCreateWithIOBluetoothSDPServiceRecordRef

Create an OBEX session with a service ref, usually obtained from the device browser.

IOBluetoothOBEXSessionOpenTransportConnection
OBEXSessionCreateWithIncomingIOBluetoothRFCOMMChannel

Create an OBEX session with an IOBluetoothRFCOMMchannel. This implies you are creating a OBEX SERVER session that will dole out info to remote Bluetooth clients.

OBEXSessionOpenTransportConnection

IOBluetoothOBEXSessionCreateWithIncomingIOBluetoothRFCOMMChannel


Create an OBEX session with an IOBluetoothRFCOMMchannel. This implies you are creating a OBEX SERVER session that will dole out info to remote Bluetooth clients.

OBEXError IOBluetoothOBEXSessionCreateWithIncomingIOBluetoothRFCOMMChannel(
    IOBluetoothRFCOMMChannelRef inRFCOMMChannelRef, 
    OBEXSessionEventCallback inCallback, 
    void *inUserRefCon, 
    OBEXSessionRef *outSessionRef ) DEPRECATED_IN_BLUETOOTH_VERSION_2_2_AND_LATER;  
Parameters
inRFCOMMChannel

A valid IOBluetoothRFCOMMChannel reference.

inGetResponseCallback

A callback for Get requests sent to your session by a remote device. Must be a valid function ptr, otherwise why even call this?

outSessionRef

A valid ptr to an IOBluetoothOBEXSessionRef; will contain the newly created session if return value is kOBEXSuccess.

Return Value

An error code value. 0 if successful.

Discussion

This assumes that the RFCOMM channel you have passed it is already open and ready to transmit data to the session.

*** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6) *** You should transition your code to Objective-C equivalents. *** This API may be removed any time in the future.


IOBluetoothOBEXSessionCreateWithIOBluetoothDeviceRefAndChannelNumber


Create an OBEX session with a device ref and an RFCOMM channel ID. This allows you to bypass the browser if you already know the SDP information.

OBEXError IOBluetoothOBEXSessionCreateWithIOBluetoothDeviceRefAndChannelNumber(
    IOBluetoothDeviceRef inDeviceRef, 
    BluetoothRFCOMMChannelID inChannelID, 
    OBEXSessionRef *outSessionRef ) DEPRECATED_IN_BLUETOOTH_VERSION_2_2_AND_LATER;  
Parameters
inDeviceRef

A valid IOBluetoothDeviceRef reference.

inChannelID

A valid RFCOMM channel ID on the target device.

outSessionRef

A valid ptr to an IOBluetoothOBEXSessionRef; will contain the newly created session if return value is kOBEXSuccess.

Return Value

An error code value. 0 if successful.

Discussion

You will use a session reference to do all OBEX interaction to a specific device. This method DOES NOT create a connection to the device of any kind.

*** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6) *** You should transition your code to Objective-C equivalents. *** This API may be removed any time in the future.


IOBluetoothOBEXSessionCreateWithIOBluetoothSDPServiceRecordRef


Create an OBEX session with a service ref, usually obtained from the device browser.

OBEXError IOBluetoothOBEXSessionCreateWithIOBluetoothSDPServiceRecordRef(
    IOBluetoothSDPServiceRecordRef inSDPServiceRef, 
    OBEXSessionRef *outSessionRef ) DEPRECATED_IN_BLUETOOTH_VERSION_2_2_AND_LATER;  
Parameters
inSDPServiceRecordRef

A valid service reference.

outSessionRef

A valid ptr to an IOBluetoothOBEXSessionRef; will contain the newly created session if return value is kOBEXSuccess.

Return Value

An error code value. 0 if successful.

Discussion

You will use a session reference to do all OBEX interaction to a specific device. This method DOES NOT create a connection to the device of any kind.

*** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6) *** You should transition your code to Objective-C equivalents. *** This API may be removed any time in the future.


IOBluetoothOBEXSessionOpenTransportConnection


OBEXError IOBluetoothOBEXSessionOpenTransportConnection(
    OBEXSessionRef inSessionRef, 
    IOBluetoothOBEXSessionOpenConnectionCallback inCallback, 
    void *inUserRefCon ) DEPRECATED_IN_BLUETOOTH_VERSION_2_2_AND_LATER;  
Parameters
inSessionRef

A valid session reference.

inCallback

A valid callback.

inUserRefCon

Optional parameter; can contain anything you wish. Will be returned in your callback just as you passed it.

Return Value

An error code value. 0 if successful.

Discussion

Opens a transport-level connection to a remote target. For example, if you are using a Bluetooth transport, this will establish the baseband/L2CAP/RFCOMM connection to a device. Once the callback is called, the connection will either be opened or have failed with a status code. That status code will most likely have originated from the transport layer being used, so you may receive a Bluetooth error, an IOKit error, etc, but a 0 status should indicate success in all cases.

*** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6) *** You should transition your code to Objective-C equivalents. *** This API may be removed any time in the future.


OBEXSessionCreateWithIncomingIOBluetoothRFCOMMChannel


Create an OBEX session with an IOBluetoothRFCOMMchannel. This implies you are creating a OBEX SERVER session that will dole out info to remote Bluetooth clients.

OBEXError IOBluetoothOBEXSessionCreateWithIncomingIOBluetoothRFCOMMChannel(
    IOBluetoothRFCOMMChannelRef inRFCOMMChannelRef, 
    OBEXSessionEventCallback inCallback, 
    void *inUserRefCon, 
    OBEXSessionRef *outSessionRef ) DEPRECATED_IN_BLUETOOTH_VERSION_2_2_AND_LATER;  
Parameters
inRFCOMMChannel

A valid IOBluetoothRFCOMMChannel reference.

inGetResponseCallback

A callback for Get requests sent to your session by a remote device. Must be a valid function ptr, otherwise why even call this?

outSessionRef

A valid ptr to an IOBluetoothOBEXSessionRef; will contain the newly created session if return value is kOBEXSuccess.

Return Value

An error code value. 0 if successful.

Discussion

This assumes that the RFCOMM channel you have passed it is already open and ready to transmit data to the session.

*** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6) *** You should transition your code to Objective-C equivalents. *** This API may be removed any time in the future.


OBEXSessionOpenTransportConnection


OBEXError IOBluetoothOBEXSessionOpenTransportConnection(
    OBEXSessionRef inSessionRef, 
    IOBluetoothOBEXSessionOpenConnectionCallback inCallback, 
    void *inUserRefCon ) DEPRECATED_IN_BLUETOOTH_VERSION_2_2_AND_LATER;  
Parameters
inSessionRef

A valid session reference.

inCallback

A valid callback.

inUserRefCon

Optional parameter; can contain anything you wish. Will be returned in your callback just as you passed it.

Return Value

An error code value. 0 if successful.

Discussion

Opens a transport-level connection to a remote target. For example, if you are using a Bluetooth transport, this will establish the baseband/L2CAP/RFCOMM connection to a device. Once the callback is called, the connection will either be opened or have failed with a status code. That status code will most likely have originated from the transport layer being used, so you may receive a Bluetooth error, an IOKit error, etc, but a 0 status should indicate success in all cases.

*** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6) *** You should transition your code to Objective-C equivalents. *** This API may be removed any time in the future.

\xA0

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

\xA0

Last Updated: 2009-10-09