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?
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).
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With