Class

IOBluetoothDevice

An instance of IOBluetoothDevice represents a single remote Bluetooth device.

Overview

An IOBluetoothDevice object may exist independent of the existence of a baseband connection with the target device. Using this object, a client can request creation and destruction of baseband connections, and request the opening of L2CAP and RFCOMM channels on the remote device. Many of the other APIs in the IOBluetooth framework will return this object, or it's C counterpart (IOBluetoothDeviceRef).

Topics

Initializers

init!(address: UnsafePointer<BluetoothDeviceAddress>!)

Returns the IOBluetoothDevice object for the given BluetoothDeviceAddress

init!(addressString: String!)

Returns the IOBluetoothDevice object for the given BluetoothDeviceAddress

Instance Properties

var addressString: String!

Get a string representation of the Bluetooth device address for the target device. The format of the string is the same as returned by IOBluetoothNSStringFromDeviceAddress().

var classOfDevice: BluetoothClassOfDevice

Gets the full class of device value for the remote device.

var connectionHandle: BluetoothConnectionHandle

Get the connection handle for the baseband connection.

var deviceClassMajor: BluetoothDeviceClassMajor

Get the major device class of the device.

var deviceClassMinor: BluetoothDeviceClassMinor

Get the minor service class of the device.

var lastNameUpdate: Date!

Get the date/time of the last successful remote name request.

var name: String!

Get the human readable name of the remote device.

var nameOrAddress: String!

Get the human readable name of the remote device. If the name is not present, it will return a string containing the device's address.

var serviceClassMajor: BluetoothServiceClassMajor

Get the major service class of the device.

var services: [Any]!

Gets an array of service records for the device.

Instance Methods

func rssi()

Get the RSSI device (if connected), above or below the golden range. If the RSSI is within the golden range, a value of 0 is returned. For the actual RSSI value, use getRawRSSI. For more information, see the Bluetooth 4.0 Core Specification.

func addToFavorites()

Adds the target device to the user's favorite devices list.

func closeConnection()

Close down the baseband connection to the device.

func getAddress()

Get the Bluetooth device address for the target device.

func getClockOffset()

Get the clock offset value of the device.

func getEncryptionMode()

Get the encryption mode for the baseband connection.

func getLastInquiryUpdate()

Get the date/time of the last time the device was returned during an inquiry.

func getLastServicesUpdate()

Get the date/time of the last SDP query.

func getLinkType()

Get the link type for the baseband connection.

func getPageScanMode()

Get the page scan mode for the device.

func getPageScanPeriodMode()

Get the value of the page scan period mode for the device.

func getPageScanRepetitionMode()

Get the value of the page scan repetition mode for the device.

func getServiceRecord(for: IOBluetoothSDPUUID!)

Search for a service record containing the given UUID.

func isConnected()

Indicates whether a baseband connection to the device exists.

func isFavorite()

Reports whether the target device is a favorite for the user.

func isIncoming()

Returns TRUE if the device connection was generated by the remote host.

func isPaired()

Returns whether the target device is paired.

func openConnection()

Create a baseband connection to the device.

func openConnection(Any!)

Create a baseband connection to the device.

func openL2CAPChannelAsync(AutoreleasingUnsafeMutablePointer<IOBluetoothL2CAPChannel?>!, withPSM: BluetoothL2CAPPSM, delegate: Any!)

Opens a new L2CAP channel to the target device. Returns immediately after starting the opening process.

func openL2CAPChannelSync(AutoreleasingUnsafeMutablePointer<IOBluetoothL2CAPChannel?>!, withPSM: BluetoothL2CAPPSM, delegate: Any!)

Opens a new L2CAP channel to the target device. Returns only after the channel is opened.

func openRFCOMMChannelSync(AutoreleasingUnsafeMutablePointer<IOBluetoothRFCOMMChannel?>!, withChannelID: BluetoothRFCOMMChannelID, delegate: Any!)

Opens a new RFCOMM channel to the target device. Returns only once the channel is open or failed to open.

func performSDPQuery(Any!)

Performs an SDP query on the target device.

func performSDPQuery(Any!, uuids: [Any]!)

Performs an SDP query on the target device with the specified service UUIDs.

func rawRSSI()

Get the raw RSSI device (if connected).

func recentAccessDate()

Returns the date/time of the most recent access of the target device.

func register(forDisconnectNotification: Any!, selector: Selector!)

Allows a client to register for device disconnect notification.

func remoteNameRequest(Any!)

Issues a remote name request to the target device.

func remoteNameRequest(Any!, withPageTimeout: BluetoothHCIPageTimeout)

Issues a remote name request to the target device.

func removeFromFavorites()

Removes the target device from the user's favorite devices list.

func requestAuthentication()

Requests that the existing baseband connection be authenticated.

func sendL2CAPEchoRequest(UnsafeMutableRawPointer!, length: UInt16)

Send an echo request over the L2CAP connection to a remote device.

func setSupervisionTimeout(UInt16)

Sets the connection supervision timeout.

Type Methods

class func favoriteDevices()

Gets an array of the user's favorite devices.

class func pairedDevices()

Gets an array of all of the paired devices on the system.

class func recentDevices(UInt)

Gets an array of recently used Bluetooth devices.

class func register(forConnectNotifications: Any!, selector: Selector!)

Allows a client to register for device connect notifications for any connection.

Relationships

Inherits From