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. QT 5.5: QLowEnergyControllerPrivate::connectToDevice(): Not implemented
Qt 6.11 is out! See what's new in the release blog

QT 5.5: QLowEnergyControllerPrivate::connectToDevice(): Not implemented

Scheduled Pinned Locked Moved Solved Mobile and Embedded
5 Posts 2 Posters 1.8k 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.
  • E Offline
    E Offline
    Encya
    wrote on last edited by
    #1

    Hi,

    After buying a Raspberry Pi 2 and using debian wheezy I finally got the blue tooth modules compiled. However I am facing a new problem while using the QLowEnergyController.

    After searching for blue tooth LE devices using the QBluetoothDeviceDiscoveryAgent class I am trying to connect using the energycontroller the following error occurs : QLowEnergyControllerPrivate::connectToDevice(): Not implemented.

    The code I'm using:

    void Quart::addDevice(const QBluetoothDeviceInfo &device)
    {
        if(device.coreConfigurations() & QBluetoothDeviceInfo::LowEnergyCoreConfiguration){
            qDebug() << "Found new device:" << device.name() << '(' << device.address().toString() << ')';
    
            QLowEnergyController *control = new QLowEnergyController(device, this);
            connect(control, SIGNAL(serviceDiscovered(QBluetoothUuid)),
                    this, SLOT(serviceDiscovered(QBluetoothUuid)));
            connect(control, SIGNAL(discoveryFinished()),
                    this, SLOT(serviceScanDone()));
            connect(control, SIGNAL(error(QLowEnergyController::Error)),
                    this, SLOT(controllerError(QLowEnergyController::Error)));
            connect(control, SIGNAL(connected()),
                    this, SLOT(deviceConnected()));
            connect(control, SIGNAL(disconnected()),
                    this, SLOT(deviceDisconnected()));
    
            control->setRemoteAddressType(QLowEnergyController::RandomAddress);
            control->connectToDevice();
        }
    }
    

    Looking in the source code of qt(5.5) I found 2 files: QLowEnergyController.cpp which contains the correct code(I think) and QLowEnergyController_p.cpp which contains nothing but some code to pass units tests and:

    qWarning() << "QLowEnergyControllerPrivate::connectToDevice(): Not implemented";
    setError(QLowEnergyController::UnknownError);
    

    Could it some how be using the wrong files? I'm am totally lost from this point.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Since you are running linux on the Raspberry Pi 2, you are probably running Bluez on it. If so, you should take a look at qlowerenergycontroller_bluez.cpp

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • E Offline
        E Offline
        Encya
        wrote on last edited by
        #3

        It is correct that I am using Bluez(5.3.7). I look at the qlowerenergycontroller_bluez.cpp file and it seems that it is the one I need. But when I look at the makefile file I can only see references to qlowerenergycontroller_p.cpp.
        qlowerenergycontroller_bluez.cpp is not mentioned once.

        I also looked at the output of my make file and there I saw an error saying my bluez version is to low to support low energy. Assuming Qt is using pkg-config I ran pkg-config --modversion bluez which gave me version 4.99 while I have installed 5.37. Could that be my problem? To fix this I placed the bluez.pc file in to /usr/lib/pkgconfig and put it in the PKG_CONFIG_PATH variable.

        When I run pkg-config --moversion bluez I gives me 5.37. I am going to recompile everything and will let you know if this solved anything.

        1 Reply Last reply
        0
        • E Offline
          E Offline
          Encya
          wrote on last edited by
          #4

          This was indeed the problem. After setting the correct pkg-config for the bluez package and recompiling qt's source I can send and receive messages with the blue tooth modules.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Great !

            Thanks for sharing the solution :)

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            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