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: wait for pairing requests
QtWS25 Last Chance

Bluetooth: wait for pairing requests

Scheduled Pinned Locked Moved Solved General and Desktop
bluetoothpairingqbluetoothlocal
6 Posts 2 Posters 2.9k 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 19 Jul 2016, 13:47 last edited by
    #1

    As stated here:

    http://doc.qt.io/qt-5/qbluetoothlocaldevice.html#requestPairing

    one can request pairing using this method.
    I'm interested in the other way out: waiting for incoming paring requests and accept (or reject).
    Thus is the phone that discovers my device and requests pairing.

    How to do that?
    Thanks!

    R 1 Reply Last reply 19 Jul 2016, 13:58
    0
    • M Mark81
      19 Jul 2016, 13:47

      As stated here:

      http://doc.qt.io/qt-5/qbluetoothlocaldevice.html#requestPairing

      one can request pairing using this method.
      I'm interested in the other way out: waiting for incoming paring requests and accept (or reject).
      Thus is the phone that discovers my device and requests pairing.

      How to do that?
      Thanks!

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 19 Jul 2016, 13:58 last edited by
      #2

      @Mark81
      correct me if i am wrong, but isn't this simply the case as soon as you set the device state to "discoverable"?!

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      M 1 Reply Last reply 19 Jul 2016, 14:02
      0
      • R raven-worx
        19 Jul 2016, 13:58

        @Mark81
        correct me if i am wrong, but isn't this simply the case as soon as you set the device state to "discoverable"?!

        M Offline
        M Offline
        Mark81
        wrote on 19 Jul 2016, 14:02 last edited by Mark81
        #3

        @raven-worx mmm, I don't think so. Of course I need to set the hostMode to discoverable. But when the phone is requesting the pairing an agent should listen to the incoming requests to accept them. I've just tried and it doesn't work. I think the same signals should be emitted like when you ask the pairing: pairingDisplayPinCode, pairingDisplayConfirmation, pairingFinished...

        R M 2 Replies Last reply 20 Jul 2016, 05:47
        0
        • M Mark81
          19 Jul 2016, 14:02

          @raven-worx mmm, I don't think so. Of course I need to set the hostMode to discoverable. But when the phone is requesting the pairing an agent should listen to the incoming requests to accept them. I've just tried and it doesn't work. I think the same signals should be emitted like when you ask the pairing: pairingDisplayPinCode, pairingDisplayConfirmation, pairingFinished...

          R Offline
          R Offline
          raven-worx
          Moderators
          wrote on 20 Jul 2016, 05:47 last edited by raven-worx
          #4

          @Mark81
          yes, and where is the difference to the mode you would like to have instead?
          Device is set to discoverable. And since then it is waiting for an incoming pairing request, no?

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          M 1 Reply Last reply 20 Jul 2016, 06:31
          0
          • M Mark81
            19 Jul 2016, 14:02

            @raven-worx mmm, I don't think so. Of course I need to set the hostMode to discoverable. But when the phone is requesting the pairing an agent should listen to the incoming requests to accept them. I've just tried and it doesn't work. I think the same signals should be emitted like when you ask the pairing: pairingDisplayPinCode, pairingDisplayConfirmation, pairingFinished...

            M Offline
            M Offline
            Mark81
            wrote on 20 Jul 2016, 06:29 last edited by
            #5

            @Mark81 Ok, I found the way. When set discoverable the phone can find my device but if you just tap on it, it doens't pair nor permanently connect. You have to request pairing as soon as you receive che connected event. If you don't do this, after a while the device disconnects.

            1 Reply Last reply
            0
            • R raven-worx
              20 Jul 2016, 05:47

              @Mark81
              yes, and where is the difference to the mode you would like to have instead?
              Device is set to discoverable. And since then it is waiting for an incoming pairing request, no?

              M Offline
              M Offline
              Mark81
              wrote on 20 Jul 2016, 06:31 last edited by
              #6

              @raven-worx no, sorry, as said in the last post it doens't listen for incoming pairing request. Is the application which has to issue a pairing request! It's quite different.

              Of course the final result is pretty the same, but I didn't understand how it works from the documentation.

              1 Reply Last reply
              0

              1/6

              19 Jul 2016, 13:47

              • Login

              • Login or register to search.
              1 out of 6
              • First post
                1/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved