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

Quick Bluetooth Connectivity

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 2 Posters 318 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.
  • ahsan737A Offline
    ahsan737A Offline
    ahsan737
    wrote on last edited by
    #1

    Currently, I am performing a scan for nearby Bluetooth using the followings:

    agent = new QBluetoothDeviceDiscoveryAgent;
        connect(agent, SIGNAL(deviceDiscovered(QBluetoothDeviceInfo)),
                this, SLOT(deviceDiscovered(QBluetoothDeviceInfo)));
        agent->start();
    

    and then the app tries to connect user-selected BT when discovery finished signal is emitted.

    connect(agent, &QBluetoothDeviceDiscoveryAgent::finished, this, &bluetooth_server::connectToDevice);
    

    this takes too long to connect, how can I make it quick and efficient?

    1 Reply Last reply
    0
    • H Offline
      H Offline
      hetalik
      wrote on last edited by
      #2

      What do you mean by too long: a few seconds?

      1 Reply Last reply
      0
      • H Offline
        H Offline
        hetalik
        wrote on last edited by
        #3

        Ah, I see what you are doing here.
        When does the user select the device: before or after the discovery?
        If it's before discovery, no need to do a discovery at all. Connect immediately.
        If during the discovery, no need to wait for finished() at all, connect as soon as user selects it (stop the discovery first) .

        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