ADC Home > Reference Library > Reference > Hardware & Drivers > Bluetooth > Bluetooth Framework Reference
|
IOBluetoothOBEXSession |
Inherits from: | OBEXSession |
Declared In: |
An OBEX Session with a Bluetooth RFCOMM channel as the transport.
An OBEXSession override. When this is called by the session baseclass, we will close the transport connection if it is opened. In our case, it will be the RFCOMM channel that needs closing.
Get the Bluetooth Device being used by the session object.
Get the Bluetooth RFCOMM channel being used by the session object.
An OBEXSession override. When this is called by the session baseclass, we will return whether or not we have a transport connection established to another OBEX server/client. In our case we will tell whether or not the RFCOMM channel to a remote device is still open.
Initializes a Bluetooth-based OBEX Session using a Bluetooth device.
Initializes a Bluetooth-based OBEX Session using an incoming RFCOMM channel.
Initializes a Bluetooth-based OBEX Session using an SDP service record.
Tells whether the target device is a Mac by checking its service record.
An OBEXSession override. When this is called by the session baseclass, we will attempt to open the transport connection. In our case, this would be an RFCOMM channel to another Bluetooth device.
If the transmission was stopped due to the lack of buffers this call restarts it.
Sends the next block of data through the RFCOMM channel.
An OBEXSession override. When this is called by the session baseclass, we will send the data we are given over our transport connection. If none is open, we could try to open it, or just return an error. In our case, it will be sent over the RFCOMM channel.
For C API support. Allows you to set the callback to be invoked when the OBEX connection is actually opened.
Allows you to set the selector to be used when a transport connection is opened, or fails to open.
Creates a Bluetooth-based OBEX Session using a Bluetooth device and a Bluetooth RFCOMM channel ID.
Creates a Bluetooth-based OBEX Session using an incoming RFCOMM channel.
Creates a Bluetooth-based OBEX Session using an SDP service record, typically obtained from a device/service browser window controller.
closeTransportConnection |
An OBEXSession override. When this is called by the session baseclass, we will close the transport connection if it is opened. In our case, it will be the RFCOMM channel that needs closing.
-(OBEXError)closeTransportConnection;
Success or failure code, describing whether the call succeeded in closing the transport connection successfully.
getDevice |
Get the Bluetooth Device being used by the session object.
-(IOBluetoothDevice*)getDevice;
An IOBluetoothDevice object.
getRFCOMMChannel |
Get the Bluetooth RFCOMM channel being used by the session object.
-(IOBluetoothRFCOMMChannel*)getRFCOMMChannel;
A IOBluetoothRFCOMMChannel object.
This could potentially be nil even though you have a valid OBEX session, because the RFCOMM channel is only valid when the session is connected.
hasOpenTransportConnection |
An OBEXSession override. When this is called by the session baseclass, we will return whether or not we have a transport connection established to another OBEX server/client. In our case we will tell whether or not the RFCOMM channel to a remote device is still open.
-(BOOL)hasOpenTransportConnection;
True or false, whether there is already an open transport connection for this OBEX session.
initWithDevice:channelID: |
Initializes a Bluetooth-based OBEX Session using a Bluetooth device.
-(id) initWithDevice:(IOBluetoothDevice*)inDevice channelID:(BluetoothRFCOMMChannelID)inChannelID;
inDevice
The bluetooth device on which to open the OBEXSession.
inChannelID
The RFCOMM channel ID to use when opening the connection.
initWithIncomingRFCOMMChannel:eventSelector:selectorTarget:refCon: |
Initializes a Bluetooth-based OBEX Session using an incoming RFCOMM channel.
-(id) initWithIncomingRFCOMMChannel:(IOBluetoothRFCOMMChannel*)inChannel eventSelector:(SEL)inEventSelector selectorTarget:(id)inEventSelectorTarget refCon:(void *)inUserRefCon;
inChannel
RFCOMM channel of the desired channel to be used.
inEventSelector
The selector to be called when an event is received.
inEventSelectorTarget
The target object that get the selector message.
inUserRefCon
caller reference constant, pass whatever you want, it will be returned to you in the selector.
initWithSDPServiceRecord: |
Initializes a Bluetooth-based OBEX Session using an SDP service record.
-(id) initWithSDPServiceRecord:(IOBluetoothSDPServiceRecord*)inSDPServiceRecord;
inSDPServiceRecord
isSessionTargetAMac |
Tells whether the target device is a Mac by checking its service record.
- (BOOL)isSessionTargetAMac;
TRUE only if device service record has Mac entry, FALSE for all else.
Tells whether the target device is a Mac by checking its service record.
openTransportConnection:selectorTarget:refCon: |
An OBEXSession override. When this is called by the session baseclass, we will attempt to open the transport connection. In our case, this would be an RFCOMM channel to another Bluetooth device.
-(OBEXError)openTransportConnection:(SEL)inSelector selectorTarget:(id)inTarget refCon:(void *)inUserRefCon;
Success or failure code.
Your selector should have the following signature:
-(void)transportConnectionSelector:(id)refcon status:(OBEXError)status;
Thus you could use it with openTransportConnection like this:
OBEXError error = [anOBEXSession openTransportConnection:@selector( transportConnectionSelector:status: ) selectorTarget:self refCon:anOBEXSession]; // or whatever you want to pass as a refCon...
Be sure to check the status code! Assume the connection was not opened unless status is kOBEXSuccess.
restartTransmission |
If the transmission was stopped due to the lack of buffers this call restarts it.
- (void)restartTransmission;
If the transmission was stopped due to the lack of buffers this call restarts it.
sendBufferTroughChannel |
Sends the next block of data through the RFCOMM channel.
- (IOReturn)sendBufferTroughChannel;
Since a send in the RFCOMM channel is broken in multiple write calls (this actually is true only if the size is grater than the RFCOMM MTU). Each write call is performed by sendBufferTroughChannel. This should never need to be overwritten.
sendDataToTransport:dataLength: |
An OBEXSession override. When this is called by the session baseclass, we will send the data we are given over our transport connection. If none is open, we could try to open it, or just return an error. In our case, it will be sent over the RFCOMM channel.
-(OBEXError)sendDataToTransport:(void *)inDataToSend dataLength:(size_t)inDataLength;
Success or failure code, describing whether the call succeeded in writing the data to the transport.
setOBEXSessionOpenConnectionCallback:refCon: |
For C API support. Allows you to set the callback to be invoked when the OBEX connection is actually opened.
-(void)setOBEXSessionOpenConnectionCallback:(IOBluetoothOBEXSessionOpenConnectionCallback)inCallback refCon:(void*)inUserRefCon;
inCallback
function to call on the target.
inUserRefCon
user's reference constant, will be returned on the callback.
setOpenTransportConnectionAsyncSelector:target:refCon: |
Allows you to set the selector to be used when a transport connection is opened, or fails to open.
-(void)setOpenTransportConnectionAsyncSelector:(SEL)inSelector target:(id)inSelectorTarget refCon:(id)inUserRefCon;
inSelector
Selector to call on the target.
inSelectorTarget
Target to be called with the selector.
inUserRefCon
User's refCon that will get passed to them when their selector is invoked.
You do not need to call this on the session typically, unless you have subclassed the OBEXSession to implement a new transport and that transport supports async opening of connections. If it does not support async open, then using this is pointless.
withDevice:channelID: |
Creates a Bluetooth-based OBEX Session using a Bluetooth device and a Bluetooth RFCOMM channel ID.
+(IOBluetoothOBEXSession*)withDevice:(IOBluetoothDevice*)inDevice channelID:(BluetoothRFCOMMChannelID)inRFCOMMChannelID;
inDevice
A valid Bluetooth device describing which device you want to connect to with Bluetooth/OBEX.
inRFCOMMChannelID
An RFCOMM Channel ID numbe that is available on the remote device. This channel will be used when the transport connection is attempted.
An OBEX session representing the device/RFCOMM channel found in the service record. nil if we failed.
Note that this does NOT mean the transport connection was open. It will be opened when OBEXConnect is invoked on the session object. IMPORTANT NOTE* In Bluetooth framework version 1.0.0, the session returned will NOT be autoreleased as it should be according to objc convention. This has been changed starting in Bluetooth version 1.0.1 and later, so it WILL be autoreleased upon return, so you will need to retain it if you want to reference it later.
withIncomingRFCOMMChannel:eventSelector:selectorTarget:refCon: |
Creates a Bluetooth-based OBEX Session using an incoming RFCOMM channel.
+(IOBluetoothOBEXSession*)withIncomingRFCOMMChannel:(IOBluetoothRFCOMMChannel*)inChannel eventSelector:(SEL)inEventSelector selectorTarget:(id)inEventSelectorTarget refCon:(void *)inUserRefCon;
inChannel
The channel to use to create a connection to a device.
inEventSelector
The selector that gets called when an event occurs on the OBEX Session.
inEventSelectorTarget
The object that is used to call the above selector.
inUserRefCon
The reference constant. Pass whatever you wish - it will be returned to you in the selector.
IMPORTANT NOTE* In Bluetooth framework version 1.0.0, the session returned will NOT be autoreleased as it should be according to objc convention. This has been changed starting in Bluetooth version 1.0.1 and later, so it WILL be autoreleased upon return, so you will need to retain it if you want to reference it later.
withSDPServiceRecord: |
Creates a Bluetooth-based OBEX Session using an SDP service record, typically obtained from a device/service browser window controller.
+(IOBluetoothOBEXSession*) withSDPServiceRecord:(IOBluetoothSDPServiceRecord*)inSDPServiceRecord;
inSDPServiceRecord
A valid SDP service record describing the service (and RFCOMM channel) you want to connect to with Bluetooth/OBEX.
An OBEX session representing the device/RFCOMM channel found in the service record. nil if we failed.
Note that this does NOT mean the transport connection was open. It will be opened when OBEXConnect is invoked on the session object. IMPORTANT NOTE* In Bluetooth framework version 1.0.0, the session returned will NOT be autoreleased as it should be according to objc convention. This has been changed starting in Bluetooth version 1.0.1 and later, so it WILL be autoreleased upon return, so you will need to retain it if you want to reference it later.
|
Last Updated: 2008-08-07