Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop discovery and start to connect #30

Open
rafifajar22 opened this issue Jun 7, 2018 · 3 comments
Open

stop discovery and start to connect #30

rafifajar22 opened this issue Jun 7, 2018 · 3 comments

Comments

@rafifajar22
Copy link

rafifajar22 commented Jun 7, 2018

I want to connect with ble device, but I only know UUID, therefore I try to discovery with UUID, discovery result managed to get ble device that I want. But when I want to connect, it can not be done because discovery continues to run, I am very confused how to stop discovery and connect with the ble device.

@Zurnaz
Copy link

Zurnaz commented Jun 9, 2018

Someone feel free to correct me if there is a better way (I'm still quite new to this library).

I found that once device_discovered is triggered on a scan I can run self.stop() to stop the scanning if the devices matches my requirements. Modified from the example in the readme:

class AnyDeviceManager(gatt.DeviceManager):
    def device_discovered(self, device):
        if(True):
            self.stop()

@rafifajar22
Copy link
Author

is not working, i don't know why super().run() blocking loop

@JlnWntr
Copy link

JlnWntr commented Dec 3, 2018

#32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants