Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

【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"



  • @micland :-( So,I can't get a bluetooth API when I use windows platform?Anyone can help??( ▼-▼ )



  • @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?)


  • Lifetime Qt Champion

    Hi,

    There's a WIP branch for Windows that you can test against. You'll need to clone the QtConnectivity module from here and checkout the wip/win branch.



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


Log in to reply