Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML Bluetooth Example

QML Bluetooth Example

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
8 Posts 3 Posters 2.4k 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.
  • A Offline
    A Offline
    albanj
    wrote on last edited by
    #1

    Hi,

    Apologies if this is a bit vague.

    I've run the QML Bluetooth Example. It runs on both Mac os and iOS but the BluetoothDiscoveryModel doesn't seem to work. It finds the devices in range but returns 00:00:00:00:00:00 as the address for all devices. It doesn't find any services in either minimal or full discovery modes.

    I'm using macOS 10.12, iOS 10.3.1, Qt 5.8

    0_1491620992529_IMG_0133.PNG

    Does anyone have any ideas on what I can do or more info I can give?

    Cheers,

    Al

    A 1 Reply Last reply
    0
    • A albanj

      Hi,

      Apologies if this is a bit vague.

      I've run the QML Bluetooth Example. It runs on both Mac os and iOS but the BluetoothDiscoveryModel doesn't seem to work. It finds the devices in range but returns 00:00:00:00:00:00 as the address for all devices. It doesn't find any services in either minimal or full discovery modes.

      I'm using macOS 10.12, iOS 10.3.1, Qt 5.8

      0_1491620992529_IMG_0133.PNG

      Does anyone have any ideas on what I can do or more info I can give?

      Cheers,

      Al

      A Offline
      A Offline
      ambershark
      wrote on last edited by
      #2

      @albanj Just a guess, does it require some sort of permissions to access the bluetooth on iOS that you aren't giving it?

      Also side note, Qt has had bluetooth problems for a long time. You may want to try another bluetooth library to see if it is a Qt issue or not.

      The vplay guys usually come through these threads but just in case they miss it, you could try their bluetooth to test with.. v-play.net. ;)

      My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

      1 Reply Last reply
      0
      • A Offline
        A Offline
        albanj
        wrote on last edited by
        #3

        Hi, thanks for your suggestions.

        Other apps (from the app store) can correctly discover the devices and their services. There doesn't appear to be any permissions needed. I have tried adding the bluetooth sharing string to my project-info.plist. I'll do a bit more reading on this though in case I've missed something.

        I do use v-play but as far as I can tell they don't do anything special with bluetooth.

        Perhaps I'll take this as an opportunity to learn swift.

        Thanks again,

        Al

        A 1 Reply Last reply
        0
        • A albanj

          Hi, thanks for your suggestions.

          Other apps (from the app store) can correctly discover the devices and their services. There doesn't appear to be any permissions needed. I have tried adding the bluetooth sharing string to my project-info.plist. I'll do a bit more reading on this though in case I've missed something.

          I do use v-play but as far as I can tell they don't do anything special with bluetooth.

          Perhaps I'll take this as an opportunity to learn swift.

          Thanks again,

          Al

          A Offline
          A Offline
          ambershark
          wrote on last edited by
          #4

          @albanj Sorry wish I had more advice to give, but I haven't written any apps for iOS yet, and Qt's bluetooth has failed me every time I've tried to use it on anything other than some simple device like a headset.

          My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

          1 Reply Last reply
          0
          • ekkescornerE Offline
            ekkescornerE Offline
            ekkescorner
            Qt Champions 2016
            wrote on last edited by
            #5

            are you sure you're not trying to get the address unde iOS or MAcOS ? this would fail !
            here's from my BT LE Example app

            QString MyBluetoothDeviceInfo::getAddress() const
            {
            #if defined (Q_OS_IOS) || defined (Q_OS_MAC)
                // On MacOS and iOS we get no access to device address,
                // only unique UUIDs generated by Core Bluetooth.
                qDebug() << "getting address from deviceUuid()";
                return mDevice.deviceUuid().toString();
            #else
                return mDevice.address().toString();
            #endif
            }
            

            I'll publish my BT LE Example apps soon - probably one week to work on ...

            ekke ... Qt Champion 2016 | 2024 ... mobile business apps
            5.15 --> 6.8 https://t1p.de/ekkeChecklist
            QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

            1 Reply Last reply
            2
            • A Offline
              A Offline
              albanj
              wrote on last edited by
              #6

              Hi,

              I've been trying to use the BluetoothDiscoveryModel QML Type

              When a device is discovered, one of the properties returned is called remoteAddress. There doesn't seem to be a distinction between address and UUID in the QML type. That could well be the problem.

              Thanks for your input. This might turn out to be a bigger small project than I was hoping for.

              Regards,

              Al

              ekkescornerE 1 Reply Last reply
              0
              • A albanj

                Hi,

                I've been trying to use the BluetoothDiscoveryModel QML Type

                When a device is discovered, one of the properties returned is called remoteAddress. There doesn't seem to be a distinction between address and UUID in the QML type. That could well be the problem.

                Thanks for your input. This might turn out to be a bigger small project than I was hoping for.

                Regards,

                Al

                ekkescornerE Offline
                ekkescornerE Offline
                ekkescorner
                Qt Champions 2016
                wrote on last edited by ekkescorner
                #7

                @albanj said in QML Bluetooth Example:

                ...This might turn out to be a bigger small project than I was hoping for.

                there's always a mistake: marketing and product managers are thinking because BT LE devices are small and cheap - same happens for the software solutions ;-)

                It's not trivial to develop a stable running BT LE APP - so many states, errors, signals, can happen

                I'm just in the process of doing this using custom BT LE devices and also a WaiterLock BT LE device (for Login/Logout)
                To separate this from the APPs where I have to integrate the BT LE device - logic I'm developing my own BT LE Example app with Scanner (Device Discovery) and exploring all the Services, Characteristics, Descriptors and also demo HowTo manage some standard devcies (HeartRate, WeightControl)

                stay tuned - my BT LE Example APP will be available at Github soon. Covering all the new stuff from Qt 5.8 and also using QtQuickControls2. Tested on mobile (Android, iOS)

                BTW: I'm doing all the BT LE stuff from Qt/C++ not QML - QML only for UI

                ekke ... Qt Champion 2016 | 2024 ... mobile business apps
                5.15 --> 6.8 https://t1p.de/ekkeChecklist
                QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

                1 Reply Last reply
                1
                • A Offline
                  A Offline
                  albanj
                  wrote on last edited by
                  #8

                  IT's just a hobby project for me. It's been a few years since I even looked at any C++. It does seem like that may be the way to go though. From the docs and the scanner example it seems like the QML side should be capable on iOS but perhaps I've missed something.

                  Thanks for your time and I look forward to your example project.

                  Al

                  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