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 - multi QT app connect to the same BLE device
Forum Updated to NodeBB v4.3 + New Features

Bluetooth - multi QT app connect to the same BLE device

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 3 Posters 1.1k 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.
  • mrjjM Offline
    mrjjM Offline
    mrjj
    Lifetime Qt Champion
    wrote on last edited by
    #3

    Hi
    The docs says
    " It is important to mention that some platforms such as a BlueZ based Linux cannot maintain two connected instances of QLowEnergyController to the same remote device. In such cases the second call to connectToDevice() may fail. This limitation may disappear at some stage in the future."

    So that could also be the case with iOS.

    Im not sure what backend is used there.

    1 Reply Last reply
    1
    • Pham HoangP Offline
      Pham HoangP Offline
      Pham Hoang
      wrote on last edited by
      #4

      @mrjj the issue happened on iOS, Android and MacOS. i haven't tested on Windows and Linux yet.
      seem, this is a issue in QT code. from QT code, to support that, i think QT should use the function:

      retrieveConnectedPeripheralsWithServices on iOS , MacOS
      and https://developer.android.com/reference/android/bluetooth/BluetoothManager#getConnectedDevices(int) on android.

      our team. find a way that create a interface class call direct those functions from OS BLE lib to get Connected headset and call it 1 more time to get data with QT API to keep work flow using QT API.

      what reasons don't QT use those function? i hope QT can support it soon in the near future

      mrjjM 1 Reply Last reply
      0
      • Pham HoangP Pham Hoang

        @mrjj the issue happened on iOS, Android and MacOS. i haven't tested on Windows and Linux yet.
        seem, this is a issue in QT code. from QT code, to support that, i think QT should use the function:

        retrieveConnectedPeripheralsWithServices on iOS , MacOS
        and https://developer.android.com/reference/android/bluetooth/BluetoothManager#getConnectedDevices(int) on android.

        our team. find a way that create a interface class call direct those functions from OS BLE lib to get Connected headset and call it 1 more time to get data with QT API to keep work flow using QT API.

        what reasons don't QT use those function? i hope QT can support it soon in the near future

        mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #5

        @Pham-Hoang
        Hi
        Please go and open an enhancement ticket at
        https://bugreports.qt.io/secure/Dashboard.jspa

        and post the link here. Then people can vote for it.

        1 Reply Last reply
        0
        • Pham HoangP Offline
          Pham HoangP Offline
          Pham Hoang
          wrote on last edited by
          #6

          Ticket: https://bugreports.qt.io/browse/QTBUG-89976

          J.HilkJ 1 Reply Last reply
          2
          • Pham HoangP Pham Hoang

            Ticket: https://bugreports.qt.io/browse/QTBUG-89976

            J.HilkJ Offline
            J.HilkJ Offline
            J.Hilk
            Moderators
            wrote on last edited by
            #7

            @Pham-Hoang you're doing this with Qt5 I assume.

            AFAIK Bluetooth and BLE will get a big overhaul in Qt6 (have a few issues I run into myself over the years that require "breaking" changes)

            IIRC Bluetooth is scheduled for 6.2 so chances are relatively high this could make it in time 🤷‍♂️. Or at least I hope so. It is an important feature after all. But I wouldn't necessarily hold my breath over it.


            Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


            Q: What's that?
            A: It's blue light.
            Q: What does it do?
            A: It turns blue.

            Pham HoangP 1 Reply Last reply
            2
            • J.HilkJ J.Hilk

              @Pham-Hoang you're doing this with Qt5 I assume.

              AFAIK Bluetooth and BLE will get a big overhaul in Qt6 (have a few issues I run into myself over the years that require "breaking" changes)

              IIRC Bluetooth is scheduled for 6.2 so chances are relatively high this could make it in time 🤷‍♂️. Or at least I hope so. It is an important feature after all. But I wouldn't necessarily hold my breath over it.

              Pham HoangP Offline
              Pham HoangP Offline
              Pham Hoang
              wrote on last edited by
              #8

              thank @J-Hilk for your information.
              can you share me what your issues you talked around BLE that make a big changes in Qt6?
              our company applications/our devices are using BLE as main connections. it is very important to understand issues around.

              and here is a issue i raised before: https://forum.qt.io/topic/120105/bluetooth-permission-from-mac-os-11-0

              J.HilkJ 1 Reply Last reply
              0
              • Pham HoangP Offline
                Pham HoangP Offline
                Pham Hoang
                wrote on last edited by
                #9

                @J-Hilk and 1 more issue. uhm, we are still support Windows 8. but QT is crashing when run on Win 8 with BLE lib. that made us cannot use QT BLE for windows built.
                i know that QT BLE don't work on Win 8. but is there a way to make it don't crash?

                1 Reply Last reply
                0
                • Pham HoangP Pham Hoang

                  thank @J-Hilk for your information.
                  can you share me what your issues you talked around BLE that make a big changes in Qt6?
                  our company applications/our devices are using BLE as main connections. it is very important to understand issues around.

                  and here is a issue i raised before: https://forum.qt.io/topic/120105/bluetooth-permission-from-mac-os-11-0

                  J.HilkJ Offline
                  J.HilkJ Offline
                  J.Hilk
                  Moderators
                  wrote on last edited by
                  #10

                  @Pham-Hoang

                  can you share me what your issues you talked around BLE

                  sure, for example this is not forwarded/handled correctly
                  https://developer.apple.com/documentation/corebluetooth/cbperipheraldelegate/1518865-peripheral?language=objc

                  i know that QT BLE don't work on Win 8. but is there a way to make it don't crash

                  so do you make an extra binary for windows 8 ? than simply #ifdef the part out, important here to also consider os guards in the pro file otherwise the build will depend on BT anyway


                  Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                  Q: What's that?
                  A: It's blue light.
                  Q: What does it do?
                  A: It turns blue.

                  Pham HoangP 1 Reply Last reply
                  1
                  • J.HilkJ J.Hilk

                    @Pham-Hoang

                    can you share me what your issues you talked around BLE

                    sure, for example this is not forwarded/handled correctly
                    https://developer.apple.com/documentation/corebluetooth/cbperipheraldelegate/1518865-peripheral?language=objc

                    i know that QT BLE don't work on Win 8. but is there a way to make it don't crash

                    so do you make an extra binary for windows 8 ? than simply #ifdef the part out, important here to also consider os guards in the pro file otherwise the build will depend on BT anyway

                    Pham HoangP Offline
                    Pham HoangP Offline
                    Pham Hoang
                    wrote on last edited by Pham Hoang
                    #11

                    @J-Hilk
                    we use the same exe file for windows 10 and 8. it helps us don't need maintains 2 installer versions for windows, reduce many issues around this.

                    J.HilkJ 1 Reply Last reply
                    0
                    • Pham HoangP Pham Hoang

                      @J-Hilk
                      we use the same exe file for windows 10 and 8. it helps us don't need maintains 2 installer versions for windows, reduce many issues around this.

                      J.HilkJ Offline
                      J.HilkJ Offline
                      J.Hilk
                      Moderators
                      wrote on last edited by
                      #12

                      @Pham-Hoang well,
                      I'm not sure if you can do much then.

                      You may get away with it, if you branch inside your code and only instanciante BlueTooth components/objects when you're not on win8

                      Because as soon as you do, the bluetoothlib is being loaded, and will try to do native calls that probably aren't there on win8 what leads to your crash (presumably)


                      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                      Q: What's that?
                      A: It's blue light.
                      Q: What does it do?
                      A: It turns blue.

                      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