Ambuja
Ambuja

Reputation: 196

Does Qt support the windows bluetooth API?

Can anyone tell me whether or not Qt supports the windows Bluetooth API? If so could you please share some information on how to use it?

Upvotes: 10

Views: 5400

Answers (3)

convexbytes
convexbytes

Reputation: 182

As January 2020 documentation, Qt 5.14 officially supports "Classic Bluetooth" for win32 builds.

However, it doesn't seem complete, here mentions a restriction about finding devices:

...it is only possible to find devices that have been previously paired through Windows Settings

Upvotes: 0

Mohammad Kanan
Mohammad Kanan

Reputation: 4592

Starting from Qt 5.11, Qt documentation says:

Despite there not being a Win32 port yet, the WinRT backend is automatically used if the win32 target platform supports the required WinRT APIs. Minimal requirement is Windows 10 version 1507 with slightly improved service discovery since Windows 10 version 1607. Therefore Windows 7 and 8.x targets are excluded.

Bluetooth Chat Example tested successfully using following setup:

Qt 5.11.1

Win10

Qt Kit MSVC2017 64 bit.

Upvotes: 3

JCooper
JCooper

Reputation: 6525

The answer to this question has changed a bit since the last response was given. Qt version 5.2 implemented a Bluetooth API for Linux/BlueZ and BlackBerry devices. Qt 5.3 includes Bluetooth support for Android. Linux devices can connect with RFCOMM or L2CAP protocols. Android and Blackberry only have RFCOMM.

Bluetooth on Windows is still not supported, but that fact is hard to find. Currently, if you create a QBluetoothSocket on Windows and tell it to connect to an address, it fails silently even though there is a built-in error-reporting mechanism. If you use the QBluetoothLocalDevice interface to retrieve devices, you get back an empty list. Although the class documentations don't mention the fact, the Bluetooth Overview clarifies that

Currently the API is supported on Android, BlackBerry 10 and Linux (Bluez 4.x).

Upvotes: 8

Related Questions