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. Dummy backend running. Qt Bluetooth module is non-functional (Bluetooth Low Energy)

Dummy backend running. Qt Bluetooth module is non-functional (Bluetooth Low Energy)

Scheduled Pinned Locked Moved Solved General and Desktop
bluetoothbluetooth low e
8 Posts 3 Posters 2.3k 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.
  • S Offline
    S Offline
    SpaceToon
    wrote on 8 Oct 2019, 14:06 last edited by
    #1

    Hello,
    I want to create a Bluetooth low Energy Application for Windows and Linux. At first, I tried to do this:

    QBluetoothLocalDevice localDevice;
    QString localDeviceName;
    
    // Check if Bluetooth is available on this device
    if (localDevice.isValid()) {
    
        // Turn Bluetooth on
        localDevice.powerOn();
    
        // Read local device name
        localDeviceName = localDevice.name();
    
        // Make it visible to others
        localDevice.setHostMode(QBluetoothLocalDevice::HostDiscoverable);
    
        // Get connected devices
        QList<QBluetoothAddress> remotes;
        remotes = localDevice.connectedDevices();
    }
    

    But the above mentioned error occured. I have read here to copmpile with MSVC, but I absolutely do not know what that is and how to do so. So is there a step by step tutorial to do this?
    Furthermore I hav read in other Thread:

    "Hi,
    One thing you can take a look at is the wip/win branch of the QtConnectivity module. It contains a work in progress Windows implementation."

    What is QtConnectivity? And how can I use this branch? As I said, I am an absolut beginner to Qt thank you very much!

    J S 2 Replies Last reply 9 Oct 2019, 05:13
    0
    • S SpaceToon
      8 Oct 2019, 14:06

      Hello,
      I want to create a Bluetooth low Energy Application for Windows and Linux. At first, I tried to do this:

      QBluetoothLocalDevice localDevice;
      QString localDeviceName;
      
      // Check if Bluetooth is available on this device
      if (localDevice.isValid()) {
      
          // Turn Bluetooth on
          localDevice.powerOn();
      
          // Read local device name
          localDeviceName = localDevice.name();
      
          // Make it visible to others
          localDevice.setHostMode(QBluetoothLocalDevice::HostDiscoverable);
      
          // Get connected devices
          QList<QBluetoothAddress> remotes;
          remotes = localDevice.connectedDevices();
      }
      

      But the above mentioned error occured. I have read here to copmpile with MSVC, but I absolutely do not know what that is and how to do so. So is there a step by step tutorial to do this?
      Furthermore I hav read in other Thread:

      "Hi,
      One thing you can take a look at is the wip/win branch of the QtConnectivity module. It contains a work in progress Windows implementation."

      What is QtConnectivity? And how can I use this branch? As I said, I am an absolut beginner to Qt thank you very much!

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 9 Oct 2019, 05:13 last edited by
      #2

      @SpaceToon said in Dummy backend running. Qt Bluetooth module is non-functional (Bluetooth Low Energy):

      MSVC, but I absolutely do not know what that is and how to do so

      MSVC is Microsoft C++ compiler. To use it you can either install the build tools from Microsoft or the Visual Studio Community edition (which is free). Then install Qt for MSVC version you installed before (you should use 2017 for now).

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

      S 2 Replies Last reply 9 Oct 2019, 12:13
      2
      • S SpaceToon
        8 Oct 2019, 14:06

        Hello,
        I want to create a Bluetooth low Energy Application for Windows and Linux. At first, I tried to do this:

        QBluetoothLocalDevice localDevice;
        QString localDeviceName;
        
        // Check if Bluetooth is available on this device
        if (localDevice.isValid()) {
        
            // Turn Bluetooth on
            localDevice.powerOn();
        
            // Read local device name
            localDeviceName = localDevice.name();
        
            // Make it visible to others
            localDevice.setHostMode(QBluetoothLocalDevice::HostDiscoverable);
        
            // Get connected devices
            QList<QBluetoothAddress> remotes;
            remotes = localDevice.connectedDevices();
        }
        

        But the above mentioned error occured. I have read here to copmpile with MSVC, but I absolutely do not know what that is and how to do so. So is there a step by step tutorial to do this?
        Furthermore I hav read in other Thread:

        "Hi,
        One thing you can take a look at is the wip/win branch of the QtConnectivity module. It contains a work in progress Windows implementation."

        What is QtConnectivity? And how can I use this branch? As I said, I am an absolut beginner to Qt thank you very much!

        S Offline
        S Offline
        sierdzio
        Moderators
        wrote on 9 Oct 2019, 05:18 last edited by
        #3

        @SpaceToon said in Dummy backend running. Qt Bluetooth module is non-functional (Bluetooth Low Energy):

        What is QtConnectivity? And how can I use this branch? As I said, I am an absolut beginner to Qt thank you very much!

        QtConnectivity is the module of Qt, QBluetooth classes are a part of it. But don't bother with it now, just use MSVC like @jsulm suggests and you will be fine. Where "fine" means QBluetooth will work, not necessarily that bluetooth itself will be reliable. Unfortunately, Microsoft's implementation of Bluetooth LE is very buggy.

        Also, make sure you use the newest Qt (right now that's 5.13.1) and fully updated Windows 10.

        (Z(:^

        1 Reply Last reply
        2
        • J jsulm
          9 Oct 2019, 05:13

          @SpaceToon said in Dummy backend running. Qt Bluetooth module is non-functional (Bluetooth Low Energy):

          MSVC, but I absolutely do not know what that is and how to do so

          MSVC is Microsoft C++ compiler. To use it you can either install the build tools from Microsoft or the Visual Studio Community edition (which is free). Then install Qt for MSVC version you installed before (you should use 2017 for now).

          S Offline
          S Offline
          SpaceToon
          wrote on 9 Oct 2019, 12:13 last edited by
          #4

          @jsulm Thank you very much, so it will not work with Microsoft Vistual Studio 2019?

          J 1 Reply Last reply 9 Oct 2019, 12:21
          0
          • S SpaceToon
            9 Oct 2019, 12:13

            @jsulm Thank you very much, so it will not work with Microsoft Vistual Studio 2019?

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 9 Oct 2019, 12:21 last edited by
            #5

            @SpaceToon said in Dummy backend running. Qt Bluetooth module is non-functional (Bluetooth Low Energy):

            Thank you very much, so it will not work with Microsoft Vistual Studio 2019?

            As far as I know there is no official support yet in Qt. That does not mean it will not work, but there is no guarantee it will. But you can try: install Qt for MSVC2017.

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

            S 1 Reply Last reply 9 Oct 2019, 12:34
            1
            • J jsulm
              9 Oct 2019, 12:21

              @SpaceToon said in Dummy backend running. Qt Bluetooth module is non-functional (Bluetooth Low Energy):

              Thank you very much, so it will not work with Microsoft Vistual Studio 2019?

              As far as I know there is no official support yet in Qt. That does not mean it will not work, but there is no guarantee it will. But you can try: install Qt for MSVC2017.

              S Offline
              S Offline
              SpaceToon
              wrote on 9 Oct 2019, 12:34 last edited by
              #6

              @jsulm Thank you, I will try :)

              1 Reply Last reply
              0
              • J jsulm
                9 Oct 2019, 05:13

                @SpaceToon said in Dummy backend running. Qt Bluetooth module is non-functional (Bluetooth Low Energy):

                MSVC, but I absolutely do not know what that is and how to do so

                MSVC is Microsoft C++ compiler. To use it you can either install the build tools from Microsoft or the Visual Studio Community edition (which is free). Then install Qt for MSVC version you installed before (you should use 2017 for now).

                S Offline
                S Offline
                SpaceToon
                wrote on 10 Oct 2019, 11:10 last edited by
                #7

                @jsulm Hello,

                I have installed VS Tools, and QT 5.13.1.
                Furthermore I opened the Example Scanner (for Bluetooth Low Energy), choosed The MSVC Compiler and it worked - I could find my device and connect to it.

                My aim is now to write an own Application, which scans, connects and sends the data from my BLE device to my PC, but it should be cross-plattform (sending data to Linux and Windows). So is it possible with the MSVC Compiler? I have read that it is possible with MinGW.
                Because I don't want to start this project and work on it for month to realize that it is not working on Linux :)

                J 1 Reply Last reply 10 Oct 2019, 11:13
                0
                • S SpaceToon
                  10 Oct 2019, 11:10

                  @jsulm Hello,

                  I have installed VS Tools, and QT 5.13.1.
                  Furthermore I opened the Example Scanner (for Bluetooth Low Energy), choosed The MSVC Compiler and it worked - I could find my device and connect to it.

                  My aim is now to write an own Application, which scans, connects and sends the data from my BLE device to my PC, but it should be cross-plattform (sending data to Linux and Windows). So is it possible with the MSVC Compiler? I have read that it is possible with MinGW.
                  Because I don't want to start this project and work on it for month to realize that it is not working on Linux :)

                  J Offline
                  J Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 10 Oct 2019, 11:13 last edited by
                  #8

                  @SpaceToon said in Dummy backend running. Qt Bluetooth module is non-functional (Bluetooth Low Energy):

                  So is it possible with the MSVC Compiler?

                  No.
                  You will need to build your code for Linux. It is better to do this on a Linux machine as cross compiling from Windows to Linux will be a lot of work. You can have a virtual machine with Linux to build for Linux.

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

                  1 Reply Last reply
                  3

                  7/8

                  10 Oct 2019, 11:10

                  • Login

                  • Login or register to search.
                  7 out of 8
                  • First post
                    7/8
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved