Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Bluetooth device discovery not working.
Forum Updated to NodeBB v4.3 + New Features

Bluetooth device discovery not working.

Scheduled Pinned Locked Moved Mobile and Embedded
6 Posts 3 Posters 3.1k 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.
  • M Offline
    M Offline
    mactro
    wrote on last edited by
    #1

    Hi! I'm trying to write an app that will communicate with a mobile robot that I built via bluetooth. I want the app to display a list of COM ports and let user to choose wich port to connect. However, QSerialPortInfo::availablePorts() yields over 10 results, which is messy. I would like to use QBluetoothDeviceDiscoveryAgent class to look only for a bt device named "robot". Unfortunately, when I run the example "btscanner" no devices appear. I also tried to specify the address:
    @QBluetoothAddress address("XX:XX:XX:XX:XX:XX");
    discoveryAgent = new QBluetoothDeviceDiscoveryAgent(address);@

    But it doesn't work either. Moreover, giving some random address doesn't produce error when I run
    @qDebug()<< discoveryAgent->error();@

    I tried on two computers, one with internal, one with external bt adapter, both running Win7.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      maurosanjo
      wrote on last edited by
      #2

      QBluetooth, unfortunately, is not supported yet on Windows.

      http://qt-project.org/doc/qt-5/qtbluetooth-index.html

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mactro
        wrote on last edited by
        #3

        Awww, that explains everything :( Is there any other way to read device's name on Windows?

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kuzulis
          Qt Champions 2020
          wrote on last edited by
          #4

          bq. Awww, that explains everything :( Is there any other way to read device’s name on Windows?

          Yes, need to use something from:

          1. Windows Bluetooth API : http://msdn.microsoft.com/en-us/library/windows/desktop/aa362927(v=vs.85).aspx

          2. Winsock Functions : http://msdn.microsoft.com/en-us/library/windows/desktop/ms741394(v=vs.85).aspx

          bq. QBluetooth, unfortunately, is not supported yet on Windows.

          But there are added a new "wip/win" branch to start support of Windows

          But, unfortunately, a contributers (for example me) don't have the free time that to implement everything.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            maurosanjo
            wrote on last edited by
            #5

            [quote author="kuzulis" date="1411652660"]
            But there are added a new "wip/win" branch to start support of Windows

            But, unfortunately, a contributers (for example me) don't have the free time that to implement everything.[/quote]

            Any links to the branch? Could not find it on codereview.

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kuzulis
              Qt Champions 2020
              wrote on last edited by
              #6

              Please see, e.g. this:

              https://codereview.qt-project.org/#/q/status:closed+project:qt/qtconnectivity+branch:wip/win,n,z

              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