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

Bluetooth problem

Scheduled Pinned Locked Moved Solved General and Desktop
13 Posts 3 Posters 1.3k Views 2 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.
  • J Offline
    J Offline
    jenya7
    wrote on last edited by
    #1

    I installed on Linux
    sudo apt-get install libbluetooth-dev
    Now I add to my *.pro
    QT += bluetooth
    However while compiling I get
    Unknown module(s) in QT ; bluetooth

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

      Hi,

      Did you forget to install the corresponding Qt module ?

      And likely the Qt Connectivity development package.

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

      J 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        Did you forget to install the corresponding Qt module ?

        And likely the Qt Connectivity development package.

        J Offline
        J Offline
        jenya7
        wrote on last edited by jenya7
        #3

        @SGaist said in Bluetooth problem:

        Hi,

        Did you forget to install the corresponding Qt module ?

        And likely the Qt Connectivity development package.

        I don't think so.

        @SGaist said in Bluetooth problem:

        Hi,

        Did you forget to install the corresponding Qt module ?

        And likely the Qt Connectivity development package.

        I don't think so
        sudo apt-get install qt5-default
        sudo apt-get install qtcreator
        And my console application works fine so far. Now I want to add bluetooth functionality to control the module on Paspberry Pi. So I installed suggested library - BlueZ
        sudo apt-get install libbluetooth-dev
        and included
        #include <bluetooth/bluetooth.h>
        #include <bluetooth/hci.h>
        #include <bluetooth/hci_lib.h>
        and Qt environment sees the libs and the functions (at list the intellisens pops-up it ) .
        But when I compile I get errors on the functions - undefined reference to 'hci_get_route'.

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

          libbluetooth != libqt5bluetooth5

          That's the later one you should check and the qtconnectivity5-dev package.

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

          J 1 Reply Last reply
          0
          • SGaistS SGaist

            libbluetooth != libqt5bluetooth5

            That's the later one you should check and the qtconnectivity5-dev package.

            J Offline
            J Offline
            jenya7
            wrote on last edited by jenya7
            #5

            @SGaist said in Bluetooth problem:

            libbluetooth != libqt5bluetooth5

            That's the later one you should check and the qtconnectivity5-dev package.

            Yes but this is a Qt library. I'm not sure it will be working with Raspberry hardware. That's why I want to port the BlueZ library.

            Pablo J. RoginaP 1 Reply Last reply
            0
            • J jenya7

              @SGaist said in Bluetooth problem:

              libbluetooth != libqt5bluetooth5

              That's the later one you should check and the qtconnectivity5-dev package.

              Yes but this is a Qt library. I'm not sure it will be working with Raspberry hardware. That's why I want to port the BlueZ library.

              Pablo J. RoginaP Offline
              Pablo J. RoginaP Offline
              Pablo J. Rogina
              wrote on last edited by
              #6

              @jenya7 said in Bluetooth problem:

              Yes but this is a Qt library

              Yes, because as it happens with lots of features in Qt framework, the support for feature X (i.e. Bluetooth in your case) come in two parts:

              1. a Qt library (i.e. Qt Connectivity module)
              2. the underlying implementation of such feature X for a particular OS (i.e. Blue) where you'll be deploying your Qt app

              Upvote the answer(s) that helped you solve the issue
              Use "Topic Tools" button to mark your post as Solved
              Add screenshots via postimage.org
              Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

              J 1 Reply Last reply
              0
              • Pablo J. RoginaP Pablo J. Rogina

                @jenya7 said in Bluetooth problem:

                Yes but this is a Qt library

                Yes, because as it happens with lots of features in Qt framework, the support for feature X (i.e. Bluetooth in your case) come in two parts:

                1. a Qt library (i.e. Qt Connectivity module)
                2. the underlying implementation of such feature X for a particular OS (i.e. Blue) where you'll be deploying your Qt app
                J Offline
                J Offline
                jenya7
                wrote on last edited by
                #7

                @Pablo-J-Rogina said in Bluetooth problem:

                @jenya7 said in Bluetooth problem:

                Yes but this is a Qt library

                Yes, because as it happens with lots of features in Qt framework, the support for feature X (i.e. Bluetooth in your case) come in two parts:

                1. a Qt library (i.e. Qt Connectivity module)
                2. the underlying implementation of such feature X for a particular OS (i.e. Blue) where you'll be deploying your Qt app

                So what should I do?

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

                  That depends on you. If you want to use libbluetooth directly, then go on but do not add QT += bluetooth to your pro file as you are not using that Qt module.

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

                  J 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    That depends on you. If you want to use libbluetooth directly, then go on but do not add QT += bluetooth to your pro file as you are not using that Qt module.

                    J Offline
                    J Offline
                    jenya7
                    wrote on last edited by jenya7
                    #9

                    @SGaist said in Bluetooth problem:

                    That depends on you. If you want to use libbluetooth directly, then go on but do not add QT += bluetooth to your pro file as you are not using that Qt module.

                    But I get an error - undefined reference to 'hci_get_route'.

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

                      If you use libbluetooth, it's your job to check whether your need to update INCLUDEPATH to add the location of the libbluetooth headers.

                      It's also your job to add the corresponding link statement to the LIBS variable.

                      If libbluetooth-dev provides a .pc file, you can use pkg-config through qmake's integration.

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

                      J 1 Reply Last reply
                      1
                      • SGaistS SGaist

                        If you use libbluetooth, it's your job to check whether your need to update INCLUDEPATH to add the location of the libbluetooth headers.

                        It's also your job to add the corresponding link statement to the LIBS variable.

                        If libbluetooth-dev provides a .pc file, you can use pkg-config through qmake's integration.

                        J Offline
                        J Offline
                        jenya7
                        wrote on last edited by
                        #11

                        @SGaist said in Bluetooth problem:

                        If you use libbluetooth, it's your job to check whether your need to update INCLUDEPATH to add the location of the libbluetooth headers.

                        It's also your job to add the corresponding link statement to the LIBS variable.

                        If libbluetooth-dev provides a .pc file, you can use pkg-config through qmake's integration.

                        That's the problem - how to link. When I used gpiod I added LIBS +=lgpiod and it works good with Qt. In this case can not find the pass to the lib.

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

                          Did you add LIBS += -lbluetooth to your .pro file ?

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

                          J 1 Reply Last reply
                          2
                          • SGaistS SGaist

                            Did you add LIBS += -lbluetooth to your .pro file ?

                            J Offline
                            J Offline
                            jenya7
                            wrote on last edited by
                            #13

                            @SGaist said in Bluetooth problem:

                            Did you add LIBS += -lbluetooth to your .pro file ?

                            OMG! As simple as that. Thank you so much! :)

                            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