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

 


OBEXBluetooth.h

Include Path:

<IOBluetooth/OBEXBluetooth.h>

Path:

/System/Library/Frameworks/IOBluetooth.framework/Versions/A/Headers/OBEXBluetooth.h

See Also:

Overview

This header contains the interfaces that define Object Exchange over Bluetooth.

For more information about accessing Bluetooth devices, see Working With Bluetooth Devices.



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 );  
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. THIS API WILL CHANGE.


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 );  
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.


IOBluetoothOBEXSessionCreateWithIOBluetoothSDPServiceRecordRef


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

OBEXError IOBluetoothOBEXSessionCreateWithIOBluetoothSDPServiceRecordRef(
    IOBluetoothSDPServiceRecordRef inSDPServiceRef, 
    OBEXSessionRef *outSessionRef );  
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.


IOBluetoothOBEXSessionOpenTransportConnection


OBEXError IOBluetoothOBEXSessionOpenTransportConnection(
    OBEXSessionRef inSessionRef, 
    IOBluetoothOBEXSessionOpenConnectionCallback inCallback, 
    void *inUserRefCon );  
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.


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 );  
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. THIS API WILL CHANGE.


OBEXSessionOpenTransportConnection


OBEXError IOBluetoothOBEXSessionOpenTransportConnection(
    OBEXSessionRef inSessionRef, 
    IOBluetoothOBEXSessionOpenConnectionCallback inCallback, 
    void *inUserRefCon );  
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.


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