Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. btscanner example does not work, cannot find BLE host device
Forum Update on Monday, May 27th 2025

btscanner example does not work, cannot find BLE host device

Scheduled Pinned Locked Moved Unsolved General and Desktop
blebluetoothbtscannerexamplehost device
5 Posts 3 Posters 3.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sen Li
    wrote on last edited by
    #1

    Hi,

    I am a newbie working on BLE examples; however none of the BLE examples work on both of my desktop with CyPress BLE dongle and my laptop.

    Could anyone help me and tell what is happening?

    I did a little modification on the btscanner example, and here is my own codes:

    QString localDeviceName;
    QBluetoothAddress dongleAddress;
    QBluetoothHostInfo dongleHostInfo;

    // Check if Bluetooth is available on this device
    QList<QBluetoothHostInfo> dongleHostInfoList = QBluetoothLocalDevice::allDevices();
    
    if (dongleHostInfoList.count() > 1){
        QStringList dongleNameStringList;
        for (int n=0; n<dongleHostInfoList.count(); n++){
            dongleNameStringList << dongleHostInfoList.at(n).name();
        }
        QString dongleNameString = QInputDialog::getItem(0, QString("Sen Dongle Select"), QString("Please select your BLE Dongle."), dongleNameStringList, 0, false);
        dongleAddress = dongleHostInfoList.at(dongleNameStringList.indexOf(dongleNameString)).address();
    } else if(dongleHostInfoList.count() == 1){
        dongleAddress = dongleHostInfoList.at(0).address();
    }else   {
        qDebug() << QString ("No Device Detected");
    }
    
    localDevice = new QBluetoothLocalDevice(dongleAddress);
    

    Unfortunately, I never find my BLE host device.

    Please help me.

    Thank you!

    1 Reply Last reply
    0
    • yeckelY Offline
      yeckelY Offline
      yeckel
      wrote on last edited by
      #2

      Hi Sen,
      What is the OS you are running your code? Does the BT device work (in Linux commands like $hcitool dev; $hcitool scan).

      S 1 Reply Last reply
      0
      • mrdebugM Offline
        mrdebugM Offline
        mrdebug
        wrote on last edited by mrdebug
        #3

        Me too. I use the linux command line tools to scan and than Qt to manage the ble.

        Need programmers to hire?
        www.labcsp.com
        www.denisgottardello.it
        GMT+1
        Skype: mrdebug

        1 Reply Last reply
        0
        • yeckelY yeckel

          Hi Sen,
          What is the OS you are running your code? Does the BT device work (in Linux commands like $hcitool dev; $hcitool scan).

          S Offline
          S Offline
          Sen Li
          wrote on last edited by
          #4

          @yeckel said:

          oes the BT device work

          I just figured it out that Qt does not support windows.
          I am going to install Linux as a second OS.

          Do you have any suggestion?

          Thank you!

          1 Reply Last reply
          0
          • yeckelY Offline
            yeckelY Offline
            yeckel
            wrote on last edited by
            #5

            Yep It's not supported on Windows. Easiest is to use Ubuntu. You should be able to install it in for example VirtualBox and share the USB device there.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved