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. LowEnergyScanner can't find any ble devices.
Forum Updated to NodeBB v4.3 + New Features

LowEnergyScanner can't find any ble devices.

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 292 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.
  • U Offline
    U Offline
    user7699
    wrote on last edited by
    #1

    Hello.

    I am trying to use Qt 5.15.2 LowEnergyScanner Example, but it can't find any devices.
    Function startDeviceDiscovery() is running, but there is no call of Device::addDevice(const QBluetoothDeviceInfo &info) function.

    Also, my OS is windows 10, and it can find my ble devices (I am not pair it in time of running Qt example).

    Also, I get some errors, but there are dont terminate application:
    qrc:/assets/main.qml:147: TypeError: Cannot read property 'update' of null
    qrc:/assets/main.qml:129: TypeError: Cannot read property 'devicesList' of null
    qrc:/assets/main.qml:83: TypeError: Cannot read property 'devicesList' of null
    qrc:/assets/main.qml:58: TypeError: Cannot read property 'state' of null
    QML debugging is enabled. Only use this in a safe environment.

    TinyB was able to find my ble devices (on same laptop, but Linux OS).

    Is there any advices?

    sierdzioS 1 Reply Last reply
    0
    • U Offline
      U Offline
      user7699
      wrote on last edited by
      #2

      In case if you need code:

      void Device::startDeviceDiscovery()
      {
      qDeleteAll(devices);
      devices.clear();
      emit devicesUpdated();
      std::cout << "11111" << std::endl;

      setUpdate("Scanning for devices ...");
      //! [les-devicediscovery-2]
      discoveryAgent->start(QBluetoothDeviceDiscoveryAgent::LowEnergyMethod);
      //! [les-devicediscovery-2]
      
      if (discoveryAgent->isActive()) {
          std::cout << "2222" << std::endl;
          m_deviceScanState = true;
          Q_EMIT stateChanged();
      }
      

      }

      //! [les-devicediscovery-3]
      void Device::addDevice(const QBluetoothDeviceInfo &info)
      {
      std::cout << "3333" << std::endl;
      if (info.coreConfigurations() & QBluetoothDeviceInfo::LowEnergyCoreConfiguration)
      setUpdate("Last device added: " + info.name());
      }

      1 Reply Last reply
      0
      • U Offline
        U Offline
        user7699
        wrote on last edited by
        #3

        The question is still relevant. Is it really that hard to get the default example to work?

        1 Reply Last reply
        0
        • U user7699

          Hello.

          I am trying to use Qt 5.15.2 LowEnergyScanner Example, but it can't find any devices.
          Function startDeviceDiscovery() is running, but there is no call of Device::addDevice(const QBluetoothDeviceInfo &info) function.

          Also, my OS is windows 10, and it can find my ble devices (I am not pair it in time of running Qt example).

          Also, I get some errors, but there are dont terminate application:
          qrc:/assets/main.qml:147: TypeError: Cannot read property 'update' of null
          qrc:/assets/main.qml:129: TypeError: Cannot read property 'devicesList' of null
          qrc:/assets/main.qml:83: TypeError: Cannot read property 'devicesList' of null
          qrc:/assets/main.qml:58: TypeError: Cannot read property 'state' of null
          QML debugging is enabled. Only use this in a safe environment.

          TinyB was able to find my ble devices (on same laptop, but Linux OS).

          Is there any advices?

          sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          @user7699 said in LowEnergyScanner can't find any ble devices.:

          (I am not pair it in time of running Qt example).

          IIRC, on Windows Qt is only able to discover paired devices.

          An improved detection system is in the works, I'm not sure if it is available in Qt 5.15 yet, I think only through custom compilation of QtBluetooth with some special flags enabled.

          (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