Skip to content

Stopping discover_devices when all devices have been listed? #98

Closed Answered by surban
kaii-lb asked this question in Q&A
Discussion options

You must be logged in to vote

discover_devices returns a stream of devices. This is not an infinite loop.

However, there is no way to be sure that all devices have been listed since Bluetooth device discovery is a stochastic process (sender and receiver need to hop on same channel simultaneously during discovery). Also new devices might become active during discovery.

You might want to wait a predefined amount of time before ending discovery, or, better yet, update your GUI every time a new device is discovered.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by kaii-lb
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants