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. DiscoveryAgent so slow compared to hcitool lescan
QtWS25 Last Chance

DiscoveryAgent so slow compared to hcitool lescan

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 2 Posters 339 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
    abeat
    wrote on last edited by
    #1

    Hi,

    are there any plans in improving the bluez usage. Comparing the discoveryagent against the hcitool lescan it the qt implementation is far slower. And by the way incorporates a lot of cached devices. Is it some how possible that qt switches to the hcitool for scanning. Or at least copies the dbus calls from this tool.

    Thanks in advance.

    Cheers

    jsulmJ 1 Reply Last reply
    0
    • A abeat

      Hi,

      are there any plans in improving the bluez usage. Comparing the discoveryagent against the hcitool lescan it the qt implementation is far slower. And by the way incorporates a lot of cached devices. Is it some how possible that qt switches to the hcitool for scanning. Or at least copies the dbus calls from this tool.

      Thanks in advance.

      Cheers

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @abeat You should ask Qt developers on their mailing list. This is user forum.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • A Offline
        A Offline
        abeat
        wrote on last edited by
        #3

        Solved it by using bt-device in a QProcess to remove all cached devices. Seems to work properly.
        For everybody interested I used it as followed before each scan Start:

        QString info = QSysInfo::kernelType();
        if (info.contains("linux")){
            QProcess process;
            process.start("bt-device -l");
            process.waitForFinished();
            QString output(process.readAllStandardOutput());
            
            // Add device token of interest
            QRegExp rx("((XXX|XX)_[\\da-f]{6})\\s");
            QStringList list;
            int pos = 0;
            
            // go through all devices
            while ((pos = rx.indexIn(output, pos)) != -1) {
                list << rx.cap(1);
                pos += rx.matchedLength();
            }
        
            for (int i = 0; i < list.size(); i++){
                if (!m_qlConnectedDevices.contains(list.at(i))){
                    process.start("bt-device -r " + list.at(i));
                    process.waitForFinished();
                    QString output(process.readAllStandardOutput());
                }
            }
        }
        
        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