A set of modern c++ classes for using bluetooth on windows. Based on the Qt Bluetooth interface. C++17.
The intent is to create a bluetooth library using Qt and winsock to fill the capability gap in Qt 5.10. Class APIs by design will be similar/identical to their Qt counterparts, and a user familiar with QtBluetooth should be able to use win-bluetooth without (much of) a learning curve.
win-bluetooth uses the same class structure, just without the Q
to start the class names. E.g. the equivalent for QBluetoothSocket
would be BluetoothSocket
.
To tun the unit tests, you will need two windows PC's with bluetooth capability in range of each other. We'll call them the "server" PC and the "client" PC.
-
Start the client PC first with the following command line options:
win-bluetooth-test.exe [LOCAL PC HOSTNAME] [LOCAL PC BLUETOOTH ADDRESS] [REMOTE PC HOSTNAME] [REMOTE PC BLUETOOTH ADDRESS] -c
example:
win-bluetooth-test.exe RELENTLESS 9C:B6:D0:DF:20:2C DAUNTLESS 5C:F3:70:84:BD:8F -c
-
Start the server PC next with the following command line options:
win-bluetooth-test.exe [LOCAL PC HOSTNAME] [LOCAL PC BLUETOOTH ADDRESS] [REMOTE PC HOSTNAME] [REMOTE PC BLUETOOTH ADDRESS]
example:
win-bluetooth-test.exe DAUNTLESS 5C:F3:70:84:BD:8F RELENTLESS 9C:B6:D0:DF:20:2C
On windows:
- Open
Device Mananger
. - Find you remote devices name under the
Bluetooth
submenu and double-click it. - Select the
Details
tab. - Select
Bluetooth device address
from theProperties
menu. - That's the address to use, just remember to insert a colon (
:
) between each set of two hex values.