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. BT: How to pair and add services
Forum Update on Monday, May 27th 2025

BT: How to pair and add services

Scheduled Pinned Locked Moved Unsolved General and Desktop
bluetootha2dphfppair
2 Posts 2 Posters 1.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.
  • M Offline
    M Offline
    Mark81
    wrote on last edited by
    #1

    I'm playing with Bluetooth classes on Qt5.6.
    My goal is to handle the pairing of a client, showing up the pin and decide which services connect: A2DP and/or HFP.

    Right now I set the local adapter in discoverable mode:

    QBluetoothLocalDevice localDevice.setHostMode(QBluetoothLocalDevice::HostDiscoverable);
    

    then I connected all signals to related slots.
    From my smartphone I discover the adapter and once clicked the deviceConnected signal is fired. Now I call:

    localDevice.requestPairing(address, QBluetoothLocalDevice::Paired);
    

    The pairingFinished signal is fired and after few seconds also the deviceDisconnected one.

    Because I request "paired" mode I was expecting also the pairingDisplayPinCode and pairingDisplayConfirmation signals.

    Furthermore, how to add services? Is there an example?

    1 Reply Last reply
    0
    • NankonN Offline
      NankonN Offline
      Nankon
      wrote on last edited by
      #2

      You use QBluetoothLocalDevce LocalDevice.is it available?what's the LocalDevice.isValid() return back?

      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