Instance Method

runModal()

Runs the service browser panel in a modal session to allow the user to select a service on a Bluetooth device.

Declaration

func runModal() -> Int32

Return Value

Returns kIOBluetoothUISuccess if a successful, validated service selection was made by the user. Returns kIOBluetoothUIUserCanceledErr if the user cancelled the panel. These return values are the same as NSRunStoppedResponse and NSRunAbortedResponse respectively. They are the standard values used in a modal session.

Discussion

The controller will use the panel attributes to filter what devices the user sees. The allowed UUIDs will be used to validate the selection the user makes. The user will only be able to select services that match the allowed UUIDs. Only when a selection has been validated (or the panel cancelled), will this method return.

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