Class

IOBluetoothOBEXSession

An OBEX Session with a Bluetooth RFCOMM channel as the transport.

Declaration

class IOBluetoothOBEXSession : OBEXSession

Overview

Topics

Initializers

init!(sdpServiceRecord: IOBluetoothSDPServiceRecord!)

Initializes a Bluetooth-based OBEX Session using an SDP service record.

init!(device: IOBluetoothDevice!, channelID: BluetoothRFCOMMChannelID)

Initializes a Bluetooth-based OBEX Session using a Bluetooth device.

Instance Methods

func closeTransportConnection() -> OBEXError

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.

func getDevice() -> IOBluetoothDevice!

Get the Bluetooth Device being used by the session object.

func getRFCOMMChannel() -> IOBluetoothRFCOMMChannel!

Get the Bluetooth RFCOMM channel being used by the session object.

func hasOpenTransportConnection() -> Bool

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.

func isSessionTargetAMac() -> Bool

Tells whether the target device is a Mac by checking its service record.

func openTransportConnection(Selector!, selectorTarget: Any!, refCon: UnsafeMutableRawPointer!) -> OBEXError

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.

func restartTransmission()

If the transmission was stopped due to the lack of buffers this call restarts it.

func sendBufferTroughChannel() -> IOReturn

Sends the next block of data through the rfcomm channel.

func sendData(toTransport: UnsafeMutableRawPointer!, dataLength: Int) -> OBEXError

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.

func setOBEXSessionOpenConnectionCallback(IOBluetoothOBEXSessionOpenConnectionCallback!, refCon: UnsafeMutableRawPointer!)

For C API support. Allows you to set the callback to be invoked when the OBEX connection is actually opened.

func setOpenTransportConnectionAsyncSelector(Selector!, target: Any!, refCon: Any!)

Allows you to set the selector to be used when a transport connection is opened, or fails to open.

Type Methods

class func withDevice(IOBluetoothDevice!, channelID: BluetoothRFCOMMChannelID) -> Self!

Creates a Bluetooth-based OBEX Session using a Bluetooth device and a Bluetooth RFCOMM channel ID.

class func withSDPServiceRecord(IOBluetoothSDPServiceRecord!) -> Self!

Creates a Bluetooth-based OBEX Session using an SDP service record, typically obtained from a device/service browser window controller.