When you call discoverPeers
in Wi-Fi Direct, it returns a list of peers to the onPeersAvailable
method in the PeerListListener
(once you call requestPeers
). However, when you call discoverServices
, you only get one service at a time to the onDnsSdServiceAvailable
method in the DnsSdServiceResponseListener
. Does anyone know if there is a way to change this and get all services available at a given time? Or if there is a particular reason why it can only return one at a time?
As far as I know there is no ways on changing this. They are just given one by one, and the timing is not really set either.
All and all, the suggested way on handling getting them all is to implement a timer, which is reset every time you get a discovery, and it is fires before it gets discovery, you would determine that all peer services have been discovered. Sucks, but that's the way it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With