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. Increasing the Scan time for QBluetoothDeviceDiscoveryAgent::Start()
Forum Updated to NodeBB v4.3 + New Features

Increasing the Scan time for QBluetoothDeviceDiscoveryAgent::Start()

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.3k 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
    spikless
    wrote on last edited by
    #1

    Hi,
    I am trying to develop a Bluetooth Application and I am using QBluetoothDeviceDiscoveryAgent::Start() to discover visible bluetooth devices.
    It works well but my problem is that, i would like the scanning to either run for a longer period or until a user double-clicks on a device detected.

    By default, I think Start() has a scan time of 10.28 seconds.

    I tried reading through the header files but can't seem to find any solution.

    Would be please if I can be assisted.

    Thank you

    1 Reply Last reply
    0
    • I Offline
      I Offline
      Iktwo
      wrote on last edited by
      #2

      I am not sure if this is configurable, but if not, you could just rescan again

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

        Thanks for your response ;)
        Please how do I rescan again?
        Is it by using QTimer or using loops since I call Start() after connecting to deviceDiscovered() signal?

        1 Reply Last reply
        0
        • I Offline
          I Offline
          Iktwo
          wrote on last edited by
          #4

          You can connect finished signal to an slot that keeps counting the times you have scanned, let's say you want to do it for a minute, so in that slot you would call start if your counter is less than 6, or something like that, hope that helps

          1 Reply Last reply
          0
          • S Offline
            S Offline
            spikless
            wrote on last edited by spikless
            #5

            Oh ok, can you please give me an example..

            connect(discov,SIGNAL(deviceDiscovered(QBluetoothDeviceInfo)),this,SLOT(detectedDevice(QBluetoothDeviceInfo)));
                connect(discov, SIGNAL(finished()), discov, SIGNAL(deviceDiscovered(QBluetoothDeviceInfo));
                connect(discov, SIGNAL(canceled()), this, SLOT(scanCompleted()));
                //Begin Device discovery
                discov->start();
            

            my deviceDiscovered(QBluetoothDeviceInfo) is used to update my QTableWidget

            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