Post

Replies

Boosts

Views

Activity

Bonjour -how to set a maximum discovery range limit
I'm using Bonjour, NWConnection, NWBrowser, and NWListener along with the NearInteraction framework. The NearInteraction framework works best when the devices are within 9 meters - https://developer.apple.com/documentation/nearbyinteraction/initiating_and_maintaining_a_session of each other. NI works best when the peer devices are: Within nine meters of each other. Is there anyway that I can set Bonjour to not discover devices beyond or only within 9 meters?
1
0
967
Jan ’21
NISessionDelegate -How to convert distance property into meters?
In the delegate method below, distance is of type Float: func session(_ session: NISession, didUpdate nearbyObjects: [NINearbyObject]) { 		guard let object = nearbyObjects.first else { return }           guard let distance = object.distance else { return }           print("distance is of type Float but I need to convert to meters: ", distance) } How do I convert distance into meters so that I can find out exactly how far the peers are from one another?
1
0
725
Jan ’21