Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 707
Ambuja Avatar asked Aug 09 '11 06:08

Ambuja


2 Answers

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).

like image 56
JCooper Avatar answered Oct 21 '22 12:10

JCooper


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.
like image 43
Mohammad Kanan Avatar answered Oct 21 '22 11:10

Mohammad Kanan