- Qt 5.15
- Qt Bluetooth
- QML Bluetooth Scanner Example
- Qt 5.15.12 Reference Documentation

# QML Bluetooth Scanner Example

A QML example about locating Bluetooth devices.

This is an example on how to locate Bluetooth devices in QML.

The user has the choice to run three different types of Bluetooth scans. The device retrieves information about the remote device within Bluetooth range. This implies that the remote device can be discovered. The picture below demonstrates the potential result of such a search:

The second and third type of scan dicover the types of services offered by each remote device. A full service discovery can take quite some time to finish. The local device connects to each remote device and performs an SDP enquiry. The results of such an enquiry can be seen below.

In general a service discovery is based on the results of a previously run device enquiry. A minimal service discovery returns the same data set as a full discovery except that the results are retrieved from local cache information and may not always be complete and accurate. The primary reason to perform a minimal discovery are time constraints. A full service discovery can take up to two minutes. Note that not every platform supports a minimal discovery. In such cases the API performs a full discovery.

#### Running the Example

To run the example from Qt Creator, open the Welcome mode and select the example from Examples. For more information, visit Building and Running an Example.

Example project @ code.qt.io

See also Qt Bluetooth.