Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

IOBluetoothDeviceMBS.addToFavorites
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.3 Yes No No Yes, macOS only No
Function: Adds the target device to the user's favorite devices list.
Notes: Lasterror is set to kIOReturnSuccess if the device was successfully added to the user's list of favorite devices.

Feedback, Comments & Corrections

IOBluetoothDeviceMBS.closeConnection
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.3 Yes No No Yes, macOS only No
Function: Close down the baseband connection to the device.
Notes:
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.

Feedback, Comments & Corrections

IOBluetoothDeviceMBS.Constructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.3 Yes No No Yes, macOS only No
Function: The constructor.

Feedback, Comments & Corrections

IOBluetoothDeviceMBS.Destructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.3 Yes No No Yes, macOS only No
Function: The destructor.

Feedback, Comments & Corrections

IOBluetoothDeviceMBS.openConnection
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.3 Yes No No Yes, macOS only No
Function: Create a baseband connection to the device.
Notes:
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.

Feedback, Comments & Corrections

IOBluetoothDeviceMBS.openConnectionAsync
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.3 Yes No No Yes, macOS only No
Function: Create a baseband connection to the device.
Notes:
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:

Feedback, Comments & Corrections

IOBluetoothDeviceMBS.openConnectionAsync(timeout as integer, authenticationRequired as boolean)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.3 Yes No No Yes, macOS only No
Function: Create a baseband connection to the device with timeout.
Notes:
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:

Feedback, Comments & Corrections

IOBluetoothDeviceMBS.performSDPQuery
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.3 Yes No No Yes, macOS only No
Function: Performs an SDP query on the target device.
Notes:
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.

Feedback, Comments & Corrections

IOBluetoothDeviceMBS.remoteNameRequest
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.3 Yes No No Yes, macOS only No
Function: Issues a remote name request to the target device.
Notes:
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:

Feedback, Comments & Corrections

IOBluetoothDeviceMBS.remoteNameRequest(pageTimeoutValue as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.3 Yes No No Yes, macOS only No
Function: Issues a remote name request to the target device.
Notes:
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:

Feedback, Comments & Corrections

IOBluetoothDeviceMBS.removeFromFavorites
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.3 Yes No No Yes, macOS only No
Function: Removes the target device from the user's favorite devices list.
Notes:
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.

Feedback, Comments & Corrections

IOBluetoothDeviceMBS.requestAuthentication
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.3 Yes No No Yes, macOS only No
Function: Requests that the existing baseband connection be authenticated.
Notes:
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.

Feedback, Comments & Corrections

IOBluetoothDeviceMBS.SendL2CAPEchoRequest(Data as MemoryBlock)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.3 Yes No No Yes, macOS only No
Function: Send an echo request over the L2CAP connection to a remote device.
Notes:
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).

Feedback, Comments & Corrections

IOBluetoothDeviceMBS.ServiceRecordForUUID(sdpUUID as IOBluetoothSDPUUIDMBS) as IOBluetoothSDPServiceRecordMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.3 Yes No No Yes, macOS only No
Function: Search for a service record containing the given UUID.
Notes:
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.

Feedback, Comments & Corrections

IOBluetoothDeviceMBS.services as IOBluetoothSDPServiceRecordMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.3 Yes No No Yes, macOS only No
Function: Gets an array of service records for the device.
Notes:
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.

Feedback, Comments & Corrections

IOBluetoothDeviceMBS.setSupervisionTimeout(timeout as integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.3 Yes No No Yes, macOS only No
Function: Sets the connection supervision timeout.
Notes:
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.

Feedback, Comments & Corrections

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




Links
MBS Xojo Plugins