|
Mac Dev Center
Mac OS X Reference Library Drivers, Kernel, & Hardware: User-Space Device Access Bluetooth Framework Reference
|
IOBluetoothOBEXSession |
| Inherits from: | |
| 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 a Bluetooth device.
Initializes a Bluetooth-based OBEX Session using an incoming RFCOMM channel.
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.
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 stopeed due to the lack of buffers this call restarts it.
Sends the next block of data trough 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.
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.
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.
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 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 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 |
Initializes a Bluetooth-based OBEX Session using a Bluetooth device.
See Also:-(id) initWithDevice:(IOBluetoothDevice*)inDevice channelID:(BluetoothRFCOMMChannelID)inChannelID;
inDeviceThe bluetooth device on which to open the OBEXSession.
inChannelIDThe RFCOMM channel ID to use when opening the connection.
initWithDevice:channelID: |
Initializes a Bluetooth-based OBEX Session using a Bluetooth device.
See Also:-(id) initWithDevice:(IOBluetoothDevice*)inDevice channelID:(BluetoothRFCOMMChannelID)inChannelID;
inDeviceThe bluetooth device on which to open the OBEXSession.
inChannelIDThe RFCOMM channel ID to use when opening the connection.
initWithIncomingRFCOMMChannel |
Initializes a Bluetooth-based OBEX Session using an incoming RFCOMM channel.
See Also:-(id) initWithIncomingRFCOMMChannel:(IOBluetoothRFCOMMChannel*)inChannel eventSelector:(SEL)inEventSelector selectorTarget:(id)inEventSelectorTarget refCon:(void *)inUserRefCon;
inChannelIDRFCOMM channel ID of the desired channel to be used.
inEventSelectorThe selector to be called when an event is received.
inEventSelectorTargetThe target object that get the selector message.
refConcaller reference constant, pass whatever you want, it will be returned to you in the selector.
initWithIncomingRFCOMMChannel:eventSelector:selectorTarget:refCon: |
Initializes a Bluetooth-based OBEX Session using an incoming RFCOMM channel.
See Also:-(id) initWithIncomingRFCOMMChannel:(IOBluetoothRFCOMMChannel*)inChannel eventSelector:(SEL)inEventSelector selectorTarget:(id)inEventSelectorTarget refCon:(void *)inUserRefCon;
inChannelIDRFCOMM channel ID of the desired channel to be used.
inEventSelectorThe selector to be called when an event is received.
inEventSelectorTargetThe target object that get the selector message.
refConcaller 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 |
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.
See Also:-(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.
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.
See Also:-(OBEXError)openTransportConnection:(SEL)inSelector selectorTarget:(id)inTarget refCon:(void *)inUserRefCon;
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 stopeed due to the lack of buffers this call restarts it.
- (void)restartTransmission;
If the transmission was stopeed due to the lack of buffers this call restarts it.
sendBufferTroughChannel |
Sends the next block of data trough 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 |
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.
See Also:Success or failure code, describing whether the call succeeded in writing the data to the transport.
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.
See Also:
setOBEXSessionOpenConnectionCallback |
For C API support. Allows you to set the callback to be invoked when the OBEX connection is actually opened.
See Also:-(void)setOBEXSessionOpenConnectionCallback:(IOBluetoothOBEXSessionOpenConnectionCallback)inCallback refCon:(void*)inUserRefCon;
inCallbackfunction to call on the target.
inUserRefConuser's reference constant, will be returned on the callback.
setOBEXSessionOpenConnectionCallback:refCon: |
For C API support. Allows you to set the callback to be invoked when the OBEX connection is actually opened.
See Also:-(void)setOBEXSessionOpenConnectionCallback:(IOBluetoothOBEXSessionOpenConnectionCallback)inCallback refCon:(void*)inUserRefCon;
inCallbackfunction to call on the target.
inUserRefConuser's reference constant, will be returned on the callback.
setOpenTransportConnectionAsyncSelector |
Allows you to set the selector to be used when a transport connection is opened, or fails to open.
See Also:-(void)setOpenTransportConnectionAsyncSelector:(SEL)inSelector target:(id)inSelectorTarget refCon:(id)inUserRefCon;
inEventSelectorSelector to call on the target.
inEventSelectorTargetTarget to be called with the selector.
inUserRefConUser'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.
setOpenTransportConnectionAsyncSelector:target:refCon: |
Allows you to set the selector to be used when a transport connection is opened, or fails to open.
See Also:-(void)setOpenTransportConnectionAsyncSelector:(SEL)inSelector target:(id)inSelectorTarget refCon:(id)inUserRefCon;
inEventSelectorSelector to call on the target.
inEventSelectorTargetTarget to be called with the selector.
inUserRefConUser'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 |
Creates a Bluetooth-based OBEX Session using a Bluetooth device and a Bluetooth RFCOMM channel ID.
See Also:+(IOBluetoothOBEXSession*)withDevice:(IOBluetoothDevice*)inDevice channelID:(BluetoothRFCOMMChannelID)inRFCOMMChannelID;
inDeviceA valid Bluetooth device describing which device you want to connect to with Bluetooth/OBEX.
inRFCOMMChannelIDAn 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.
withDevice:channelID: |
Creates a Bluetooth-based OBEX Session using a Bluetooth device and a Bluetooth RFCOMM channel ID.
See Also:+(IOBluetoothOBEXSession*)withDevice:(IOBluetoothDevice*)inDevice channelID:(BluetoothRFCOMMChannelID)inRFCOMMChannelID;
inDeviceA valid Bluetooth device describing which device you want to connect to with Bluetooth/OBEX.
inRFCOMMChannelIDAn RFCOMM Channel ID numbe that is available on the remote device. This channel will be used when the transport connection is attempted.
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 |
Creates a Bluetooth-based OBEX Session using an incoming RFCOMM channel.
See Also:+(IOBluetoothOBEXSession*)withIncomingRFCOMMChannel:(IOBluetoothRFCOMMChannel*)inChannel eventSelector:(SEL)inEventSelector selectorTarget:(id)inEventSelectorTarget refCon:(void *)inUserRefCon;
inChannelThe channel to use to create a connection to a device.
inEventSelectorThe selector that gets called when an event occurs on the OBEX Session.
inEventSelectorTargetThe object that is used to call the above selector.
inUserRefConThe 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.
withIncomingRFCOMMChannel:eventSelector:selectorTarget:refCon: |
Creates a Bluetooth-based OBEX Session using an incoming RFCOMM channel.
See Also:+(IOBluetoothOBEXSession*)withIncomingRFCOMMChannel:(IOBluetoothRFCOMMChannel*)inChannel eventSelector:(SEL)inEventSelector selectorTarget:(id)inEventSelectorTarget refCon:(void *)inUserRefCon;
inChannelThe channel to use to create a connection to a device.
inEventSelectorThe selector that gets called when an event occurs on the OBEX Session.
inEventSelectorTargetThe object that is used to call the above selector.
inUserRefConThe 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;
inSDPServiceRecordA 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: 2009-10-09