Platforms to show: All Mac Windows Linux Cross-Platform
/Bluetooth/Mac Bluetooth/Mac Bluetooth Devices
Required plugins for this example: MBS Bluetooth Plugin
Last modified Fri, 18th Dec 2025.
You find this example project in your MBS Xojo Plugin download as a Xojo project file within the examples folder: /Bluetooth/Mac Bluetooth/Mac Bluetooth Devices
Download this example: Mac Bluetooth Devices.zip
Project "Mac Bluetooth Devices.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class MainWindow Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
Control StartButton Inherits PushButton
ControlInstance StartButton Inherits PushButton
EventHandler Sub Action()
Start
End EventHandler
End Control
Control StopButton Inherits PushButton
ControlInstance StopButton Inherits PushButton
EventHandler Sub Action()
stop
End EventHandler
End Control
Control Wheel Inherits ProgressWheel
ControlInstance Wheel Inherits ProgressWheel
End Control
EventHandler Sub Open()
Inquiry = new IOBluetoothDeviceInquiry
Inquiry.list = list
End EventHandler
Sub Completed()
StartButton.Enabled = true
StopButton.Enabled = false
Wheel.Visible = false
End Sub
Sub Start()
Inquiry.Start
StartButton.Enabled = false
StopButton.Enabled = true
End Sub
Sub Started()
Wheel.Visible = true
End Sub
Sub Stop()
Inquiry.stop
End Sub
Property Inquiry As IOBluetoothDeviceInquiry
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
Class IOBluetoothDeviceInquiry Inherits IOBluetoothDeviceInquiryMBS
EventHandler Sub Complete(error as Integer, aborted as Boolean)
mainWindow.Completed
End EventHandler
EventHandler Sub DeviceFound(device as IOBluetoothDeviceMBS)
dim f as string
dim p as string
if device.isPaired then
p = "✔︎"
end if
if device.isFavorite then
f = "✔︎"
end if
list.AddRow device.name, device.addressString, f, p
End EventHandler
EventHandler Sub Started()
MainWindow.Started
End EventHandler
Property list As listbox
End Class
Sign
End Sign
ExternalFile info
End ExternalFile
End Project
See also:
- /Bluetooth/Mac Bluetooth/Bluetooth LE Heart Rate Mac
- /Bluetooth/Mac Bluetooth/CoreBluetooth Devices
- /Bluetooth/Mac Bluetooth/Mac Bluetooth Connection
- /Bluetooth/Mac Bluetooth/Mac Bluetooth Dialogs
Download this example: Mac Bluetooth Devices.zip
The items on this page are in the following plugins: MBS Bluetooth Plugin.