Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. BluetoothService object convert to QBluetoothServiceInfo object
Forum Updated to NodeBB v4.3 + New Features

BluetoothService object convert to QBluetoothServiceInfo object

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 2 Posters 714 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.
  • G Offline
    G Offline
    GoodMorninSunshine
    wrote on last edited by
    #1

    Hi All,

    Im trying to get a bluetooth communication going between an Android mobile and a bluetooth enabled Desktop PC.

    I have been scanning the bluetooth services from Android using the BluetoothDiscoveryModel QML type, which returns a BluetoothService object type. Now I want to connect to a selected bluetooth service but Im doing this from C++ (not QML). So I need to convert the BluetoothService object into a QBluetoothServiceInfo object.

    How do I do this? Any ideas would be really helpful. Ive been stuck on this for days now! :(

    Thanks a bunch!

    1 Reply Last reply
    0
    • S Offline
      S Offline
      s.frings74
      wrote on last edited by
      #2

      You do not need a QBluetoothServiceInfo to open a connection. You only need the destination addressand either the port number or the service UUID.

      BluetoothService provides the address and the UUID - so you have already what you need.

      QBluetoothSocket::connectToService(const QBluetoothAddress & address, const QBluetoothUuid & uuid, OpenMode openMode = ReadWrite)

      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