Platforms to show: All Mac Windows Linux Cross-Platform

Back to IOBluetoothDeviceMBS class.

IOBluetoothDeviceMBS.addToFavorites

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS Bluetooth Plugin 18.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Adds the target device to the user's favorite devices list.

Lasterror is set to kIOReturnSuccess if the device was successfully added to the user's list of favorite devices.

IOBluetoothDeviceMBS.closeConnection

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS Bluetooth Plugin 18.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Close down the baseband connection to the device.

Lasterror is set to kIOReturnSuccess if the connection has successfully been closed.

This method is synchronous and will not return until the connection has been closed (or the command failed). In the future this API will be changed to allow asynchronous operation.

IOBluetoothDeviceMBS.Constructor   Private

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS Bluetooth Plugin 18.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The private constructor.

IOBluetoothDeviceMBS.Destructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS Bluetooth Plugin 18.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The destructor.

IOBluetoothDeviceMBS.openConnection

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS Bluetooth Plugin 18.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Create a baseband connection to the device.

Lasterror is set to kIOReturnSuccess if the connection was successfully created.

This method is synchronous and will not return until either a connection has been established or the create connection has failed (perhaps timed out).

If authentication or a non-default page timeout is required the method openConnectionAsync() should be used instead.

As of OS X 10.7, this method will no longer mask out "Connection Exists" 'errors' with a success result code; your code must account for the cases where the baseband connection is already open.

IOBluetoothDeviceMBS.openConnectionAsync

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS Bluetooth Plugin 18.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Create a baseband connection to the device.

Sets lasterror to kIOReturnSuccess if the connection was successfully created (or if asynchronous, if the CREATE_CONNECTION command was successfully issued).

The open connection call is asynchronous and on completion of the CREATE_CONNECTION command, the connectionCompleted event will be called on the specified target. If no target is specified, the call is synchronous and will not return until the connection is open or the CREATE_CONNECTION call has failed. This call with proceed without authentication required, and using the default page timeout value. If authentication or a non-default page timeout is required the method openConnectionAsync() with timeout should be used instead.

As of OS X 10.7, this method will no longer mask out "Connection Exists" 'errors' with a success result code; your code must account for the cases where the baseband connection is already open.

See also:

IOBluetoothDeviceMBS.openConnectionAsync(timeout as integer, authenticationRequired as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS Bluetooth Plugin 18.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Create a baseband connection to the device with timeout.

Sets lasterror to kIOReturnSuccess if the connection was successfully created (or if asynchronous, if the CREATE_CONNECTION command was successfully issued).

The open connection call is asynchronous and on completion of the CREATE_CONNECTION command, the connectionCompleted event will be called on the specified target. If no target is specified, the call is synchronous and will not return until the connection is open or the CREATE_CONNECTION call has failed.

As of OS X 10.7, this method will no longer mask out "Connection Exists" 'errors' with a success result code; your code must account for the cases where the baseband connection is already open.

See also:

IOBluetoothDeviceMBS.performSDPQuery

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS Bluetooth Plugin 18.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Performs an SDP query on the target device.

Lasterror is set to kIOReturnSuccess if the SDP query was successfully started.

As a result of this call, a baseband connection will be built to the device (if not already connected). Then, an L2CAP channel will be opened to the SDP server on the device. At that point, a Service Search Attribute request will be issued with a UUID of 0x0100 (L2CAP) and an attribute range of 0 - &hffff specified. This will cause the SDP server to return all attributes of all L2CAP-derived services on the device. The results essentially encompass all services on the device. This function is always asynchronous.

When the SDP query is complete (or an error is encountered), the SDPQueryCompleted event will be called.

IOBluetoothDeviceMBS.remoteNameRequest

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS Bluetooth Plugin 18.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Issues a remote name request to the target device.

Lasterror is set to kIOReturnSuccess if the remote name request was successfully issued (and if synchronous, if the request completed successfully).

Later remoteNameRequestCompleted is called with result.

This call with operate with the default page timeout value. If a different page timeout value is desired, please pass pageTimeoutValue parameter.

See also:

IOBluetoothDeviceMBS.remoteNameRequest(pageTimeoutValue as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS Bluetooth Plugin 18.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Issues a remote name request to the target device.

Lasterror is set to kIOReturnSuccess if the remote name request was successfully issued (and if synchronous, if the request completed successfully).

Later remoteNameRequestCompleted is called with result.

This call with operate with the default page timeout value. If a different page timeout value is desired, please pass pageTimeoutValue parameter.

See also:

IOBluetoothDeviceMBS.removeFromFavorites

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS Bluetooth Plugin 18.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Removes the target device from the user's favorite devices list.

Lasterror is set to kIOReturnSuccess if the device was successfully removed from the user's list of favorite devices.

This method is only available in macOS 10.2.4 (Bluetooth v1.1) or later.

IOBluetoothDeviceMBS.requestAuthentication

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS Bluetooth Plugin 18.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Requests that the existing baseband connection be authenticated.

Returns kIOReturnSuccess if the connection has been successfully been authenticated. Returns an error if authentication fails or no baseband connection exists.

In order to authenticate a baseband connection, a link key needs to be generated as a result of the pairing process. This call will synchronously initiate the pairing process with the target device and not return until the authentication process is complete. This API will be updated to allow for asynchronous operation.

IOBluetoothDeviceMBS.SendL2CAPEchoRequest(Data as MemoryBlock)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS Bluetooth Plugin 18.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Send an echo request over the L2CAP connection to a remote device.

data: Buffer to send.

Lasterror is set to kIOReturnSuccess if the echo request was able to be sent.

The current implementation returns when the request has been sent, but does not indicate when a response is received. Also, the baseband connection must be up for the echo request to be sent. In the future, this method will also open the connection if necessary. The API will be updated to allow the client to be informed when the echo response has been received (both synchronously and asynchronously).

IOBluetoothDeviceMBS.ServiceRecordForUUID(sdpUUID as IOBluetoothSDPUUIDMBS) as IOBluetoothSDPServiceRecordMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS Bluetooth Plugin 18.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Search for a service record containing the given UUID.

sdpUUID: UUID value to search for.

Returns the first service record that contains the given uuid. If no service record is found, nil is returned.

This method searches through the device's services to find a service that contains the given UUID. Only the first service record will be returned. This method only operates on services that have already been queried. It will not initiate a new query. This method should probably be updated to return an array of service records if more than one contains the UUID.

IOBluetoothDeviceMBS.services as IOBluetoothSDPServiceRecordMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS Bluetooth Plugin 18.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Gets an array of service records for the device.

Returns an array of service records for the device if an SDP query has been performed. If no SDP query has been performed, nil is returned.

The resulting array contains IOBluetoothSDPServiceRecord objects. The service records are only present if an SDP query has been done on the target object. This can be determined by calling LastServicesUpdate. It will return the last date/time of the SDP query. To initiate an SDP query on a device, use performSDPQuery: as defined above.
Instead of allowing individual clients to query for different services and service attributes, the system request all of the device's services and service attributes.

IOBluetoothDeviceMBS.setSupervisionTimeout(timeout as integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS Bluetooth Plugin 18.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Sets the connection supervision timeout.

timeout: A client-supplied link supervision timeout value to use to monitor the connection. The timeout value should be specified in slots, so you can use the BluetoothGetSlotsFromSeconds macro to get the proper value. e.g. BluetoothGetSlotsFromSeconds( 5.0 ) will give yield the proper number of slots (8000) for 5 seconds.

Sets lasterror to kIOReturnSuccess if it was possible to set the connection supervision timeout.

This method is only available in macOS 10.5 (Bluetooth v2.0) or later.

The items on this page are in the following plugins: MBS Bluetooth Plugin.


The biggest plugin in space...