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 Updated to NodeBB v4.3 + New Features

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 1 Watching
  • 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 15 Nov 2015, 02:32 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
    • Y Offline
      Y Offline
      yeckel
      wrote on 15 Nov 2015, 17:21 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 15 Nov 2015, 18:37
      0
      • M Offline
        M Offline
        mrdebug
        wrote on 15 Nov 2015, 18:24 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
        • Y yeckel
          15 Nov 2015, 17:21

          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 15 Nov 2015, 18:37 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
          • Y Offline
            Y Offline
            yeckel
            wrote on 16 Nov 2015, 07:56 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

            5/5

            16 Nov 2015, 07:56

            • Login

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