Dummy backend running. Qt Bluetooth module is non-functional (Bluetooth Low Energy)
-
Hello,
I want to create a Bluetooth low Energy Application for Windows and Linux. At first, I tried to do this:QBluetoothLocalDevice localDevice; QString localDeviceName; // Check if Bluetooth is available on this device if (localDevice.isValid()) { // Turn Bluetooth on localDevice.powerOn(); // Read local device name localDeviceName = localDevice.name(); // Make it visible to others localDevice.setHostMode(QBluetoothLocalDevice::HostDiscoverable); // Get connected devices QList<QBluetoothAddress> remotes; remotes = localDevice.connectedDevices(); }
But the above mentioned error occured. I have read here to copmpile with MSVC, but I absolutely do not know what that is and how to do so. So is there a step by step tutorial to do this?
Furthermore I hav read in other Thread:"Hi,
One thing you can take a look at is the wip/win branch of the QtConnectivity module. It contains a work in progress Windows implementation."What is QtConnectivity? And how can I use this branch? As I said, I am an absolut beginner to Qt thank you very much!
-
@SpaceToon said in Dummy backend running. Qt Bluetooth module is non-functional (Bluetooth Low Energy):
MSVC, but I absolutely do not know what that is and how to do so
MSVC is Microsoft C++ compiler. To use it you can either install the build tools from Microsoft or the Visual Studio Community edition (which is free). Then install Qt for MSVC version you installed before (you should use 2017 for now).
-
@SpaceToon said in Dummy backend running. Qt Bluetooth module is non-functional (Bluetooth Low Energy):
What is QtConnectivity? And how can I use this branch? As I said, I am an absolut beginner to Qt thank you very much!
QtConnectivity is the module of Qt, QBluetooth classes are a part of it. But don't bother with it now, just use MSVC like @jsulm suggests and you will be fine. Where "fine" means QBluetooth will work, not necessarily that bluetooth itself will be reliable. Unfortunately, Microsoft's implementation of Bluetooth LE is very buggy.
Also, make sure you use the newest Qt (right now that's 5.13.1) and fully updated Windows 10.
-
@SpaceToon said in Dummy backend running. Qt Bluetooth module is non-functional (Bluetooth Low Energy):
Thank you very much, so it will not work with Microsoft Vistual Studio 2019?
As far as I know there is no official support yet in Qt. That does not mean it will not work, but there is no guarantee it will. But you can try: install Qt for MSVC2017.
-
@jsulm Hello,
I have installed VS Tools, and QT 5.13.1.
Furthermore I opened the Example Scanner (for Bluetooth Low Energy), choosed The MSVC Compiler and it worked - I could find my device and connect to it.My aim is now to write an own Application, which scans, connects and sends the data from my BLE device to my PC, but it should be cross-plattform (sending data to Linux and Windows). So is it possible with the MSVC Compiler? I have read that it is possible with MinGW.
Because I don't want to start this project and work on it for month to realize that it is not working on Linux :) -
@SpaceToon said in Dummy backend running. Qt Bluetooth module is non-functional (Bluetooth Low Energy):
So is it possible with the MSVC Compiler?
No.
You will need to build your code for Linux. It is better to do this on a Linux machine as cross compiling from Windows to Linux will be a lot of work. You can have a virtual machine with Linux to build for Linux.