Bluetooth: wait for pairing requests
As stated here:
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?
correct me if i am wrong, but isn't this simply the case as soon as you set the device state to "discoverable"?!
@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...
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?
@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.
@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.