【Error:qt.bluetooth: Dummy backend running】A problem about using qbluetooth
-
I am starting to do some work about bluetooth ,and I find an example on Qt tutorial and the code is like this:
#include <QCoreApplication> #include <QBluetoothLocalDevice> #include <QDebug> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QBluetoothLocalDevice localDevice; QString localDevicename; if (localDevice.isValid()){ localDevice.powerOn(); localDevicename=localDevice.name(); if (localDevicename.isEmpty()|localDevicename.isNull()){ qDebug()<<"Nothing found in blue!"; } localDevice.setHostMode(QBluetoothLocalDevice::HostDiscoverable); QList<QBluetoothAddress> remotes; remotes = localDevice.connectedDevices(); qDebug()<<"The number of remoted devices is %d"<<remotes.size(); }else qDebug()<<"My bluetooth didn't find!"; return a.exec(); }
Nonetheless,the result told me:
qt.bluetooth: Dummy backend running. Qt Bluetooth module is non-functional.
My bluetooth didn't find!It seems i didn't use any Virtual Machine tool or something else,so,how to solve it?
-
@MartinChan
Unfortunately bluetooth is currently not (yet) supported on the windows platform.
(see http://doc.qt.io/qt-5/qtbluetooth-index.html)
"Currently, the API is supported on the following platforms: Android, iOS, Linux (BlueZ 4.x/5.x) and OS X" -
@MartinChan
I think it's planned for futurue releases but the current version (5.7) comes not with builtin BT support on windows. So you can't use bluetooth on windows without a platform specific native implementation or a 3rd party library (perhaps someone else can suggest a Qt independant solution?) -
Maybe there're two ways to solve this question:
1)Windows SDK has included the bluetooth module,if you're familiar with Windows API development,it's a good choice to transplant it to Qt.
2)There're some 3r-party sdk like Bluesoleil SDK.