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. Easy bluetooth wrapper in Qt
Forum Updated to NodeBB v4.3 + New Features

Easy bluetooth wrapper in Qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 376 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.
  • ocgltdO Offline
    ocgltdO Offline
    ocgltd
    wrote on last edited by ocgltd
    #1

    I want to build a mobile app (Android) in Qt that will talk to my Linux server. Both devices will be running Qt apps that I will develop. I want the two devices to talk using Bluetooth, so I've been looking for an easy way to do that. The Linux app will be the "server", and the mobile will be the "client" from a Bluetooth perspective.

    From my first pass of reading about Bluetooth and Bluetooth LE, this looks pretty complicated. I'm hoping that Qt has made a nice simple wrapper that will make my life easier. But looking at the docs it still seems I need to learn a LOT about Bluetooth LE.

    Is there an example Bluetooth client and server app available somewhere in the Qt archives? If not, can someone recommend a good source (website or book) that will help me along the learning curve?

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

      Hi,

      Did you already check the examples from the module ?

      Depending on how you want to implement your system, the chat example might be fine otherwise, a combo of the heart rate server and game.

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

      ocgltdO 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Did you already check the examples from the module ?

        Depending on how you want to implement your system, the chat example might be fine otherwise, a combo of the heart rate server and game.

        ocgltdO Offline
        ocgltdO Offline
        ocgltd
        wrote on last edited by ocgltd
        #3

        @SGaist I looked at the chat example and it might be close to what I want. The example does not mention anything about pairing...is that not required for BLE?

        I'm trying to implement the equivalent of SPP, but I want to use BLE to ensure IOS support. Would the chat example provide the equivalent of a network socket connection between 2 devices?

        I found a couple of articles which discuss implementing the equivalent of SPP over LE:
        Article 1
        Article 2

        But it's not clear how these would differ from the chat example? Why create a READ attribute and a WRITE attribute (as shown in the above to articles) to move data in either direction if the chat example creates a readable/writeable socket?

        A SGaistS 2 Replies Last reply
        0
        • ocgltdO ocgltd

          @SGaist I looked at the chat example and it might be close to what I want. The example does not mention anything about pairing...is that not required for BLE?

          I'm trying to implement the equivalent of SPP, but I want to use BLE to ensure IOS support. Would the chat example provide the equivalent of a network socket connection between 2 devices?

          I found a couple of articles which discuss implementing the equivalent of SPP over LE:
          Article 1
          Article 2

          But it's not clear how these would differ from the chat example? Why create a READ attribute and a WRITE attribute (as shown in the above to articles) to move data in either direction if the chat example creates a readable/writeable socket?

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

          @ocgltd I have be coding Bluetooth app for months now. I do not code 24/7, however. if you like i could share my experiences, but prefer not here.
          I would have to say this - majority of Bluetooth example code is based on very old C code which is based on "bluez" library. QT "Bluetooth module" is also based on "bluez" library. QT examples follow the "bluez" library ways of NOT documenting the code. It is frustrating to get the code working only to find / receive undocumented "bluez" errors...

          As far as "pairing " goes - yes I believe one of the QT example has no pairing code at al....
          it is peculiar that QT can "scan" for remote devices WITHOUT pairing...

          I also found that :"socket" is used by accident and again not explained in QT code ...

          I do not want to discourage you, but I call it as I see it.

          PS
          The there are few gems like this in documetati0n

          If address is default constructed, services will be discovered on all contactable Bluetooth devices.

          1 Reply Last reply
          0
          • ocgltdO ocgltd

            @SGaist I looked at the chat example and it might be close to what I want. The example does not mention anything about pairing...is that not required for BLE?

            I'm trying to implement the equivalent of SPP, but I want to use BLE to ensure IOS support. Would the chat example provide the equivalent of a network socket connection between 2 devices?

            I found a couple of articles which discuss implementing the equivalent of SPP over LE:
            Article 1
            Article 2

            But it's not clear how these would differ from the chat example? Why create a READ attribute and a WRITE attribute (as shown in the above to articles) to move data in either direction if the chat example creates a readable/writeable socket?

            SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @ocgltd I do not have a deep knowledge of BLE but based on the articles you linked, it would be possible to implement the chat example with a custom service.

            The chat example uses a Bluetooth standard protocol that is not available in Bluetooth LE.

            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