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. Remove bluetooth device using Qt Bluetooth - long shot question

Remove bluetooth device using Qt Bluetooth - long shot question

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 597 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    Since there in no similar post I'll try this.
    I fully understand that 99.999% of posts here are NOT about coding but about GUI. NOTHING wrong with that, but makes one wonder why bother posting such long shot question about coding..
    Anyway - in QT bluetooth there are TWO classes to "inquire" about "nearby " devices or services.
    I am using both and they sort of work.

    Since my app and my OS and " Bluetooth Manager" are not happily interacting with each other I found out that if I REMOVE the discovered DEVICE ( using Bluetooth Manager) my app will work - discover all "nearby devices" reliably but ONE time only.

    I am therefore asking this - anybody has any suggestion how to utilize QT Bluetooth "module" to programmatically ( in code ) REMOVE discovered device ?

    Mrs Google just wants to discover not remove.

    PS I will be searching for other forums where posting similar question may be more appropriate.

    Pl45m4P 1 Reply Last reply
    0
    • A Anonymous_Banned275

      Since there in no similar post I'll try this.
      I fully understand that 99.999% of posts here are NOT about coding but about GUI. NOTHING wrong with that, but makes one wonder why bother posting such long shot question about coding..
      Anyway - in QT bluetooth there are TWO classes to "inquire" about "nearby " devices or services.
      I am using both and they sort of work.

      Since my app and my OS and " Bluetooth Manager" are not happily interacting with each other I found out that if I REMOVE the discovered DEVICE ( using Bluetooth Manager) my app will work - discover all "nearby devices" reliably but ONE time only.

      I am therefore asking this - anybody has any suggestion how to utilize QT Bluetooth "module" to programmatically ( in code ) REMOVE discovered device ?

      Mrs Google just wants to discover not remove.

      PS I will be searching for other forums where posting similar question may be more appropriate.

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @AnneRanch

      If you use QBluetoothDeviceDiscoveryAgent for device discovery, you get a QList of discovered devices. Restarting the discovery will re-populate that list and as long as you haven't connected to any device, you can just refresh that list

      https://doc-snapshots.qt.io/qt5-5.15/qbluetoothdevicediscoveryagent.html#deviceDiscovered


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      A 1 Reply Last reply
      0
      • Pl45m4P Pl45m4

        @AnneRanch

        If you use QBluetoothDeviceDiscoveryAgent for device discovery, you get a QList of discovered devices. Restarting the discovery will re-populate that list and as long as you haven't connected to any device, you can just refresh that list

        https://doc-snapshots.qt.io/qt5-5.15/qbluetoothdevicediscoveryagent.html#deviceDiscovered

        A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by
        #3

        @Pl45m4 said in Remove bluetooth device using Qt Bluetooth - long shot question:

        @AnneRanch

        If you use QBluetoothDeviceDiscoveryAgent for device discovery, you get a QList of discovered devices. Restarting the discovery will re-populate that list and as long as you haven't connected to any device, you can just refresh that list

        https://doc-snapshots.qt.io/qt5-5.15/qbluetoothdevicediscoveryagent.html#deviceDiscovered

        Yes, I am actually looking at the list, after
        deviceDiscovered SIGNAL is received .

        And my expectation is each subsequent time deviceDiscovered SIGNAL is received the info SHOULD contain actual info "discovered".

        It does not!

        I get the SIGNAL without ANY data in info !

        The only time it works as expected is when I manually "delete"
        the device found using Bluetooth Manager app.

        I do not know HOW is SIGNAL deviceDiscovered SIGNAL generated with EMPTY info.

        This is easy to observe - real SIGNAL deviceDiscovered is generated after max of 12 second, faulty / empty SIGNAL is generated IMMEDIATELY .

        I am open to suggestions how to make sure SUBSEQUENT scan produce real info .

        I am actually thinking to implement paring / connect / disconnect...
        Maybe that will work.

        Or find out the source code for Bluetooth Manager and see how they do the device deletion.

        void CCC_DiscoverDevice::deviceDiscovered(const QBluetoothDeviceInfo &info)
        {

        qDebug ("void CCC_DiscoverDevice:deviceDiscovered()");
        ui->plainTextEdit->appendPlainText("Nearby BT device ");
        ui->plainTextEdit->appendPlainText(info.name());
        ui->plainTextEdit->appendPlainText(info.address().toString());
        //exit(42);
        

        }

        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