gatt-python icon indicating copy to clipboard operation
gatt-python copied to clipboard

stop discovery and start to connect

Open rafifajar22 opened this issue 7 years ago • 3 comments

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.

rafifajar22 avatar Jun 07 '18 07:06 rafifajar22

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()

Zurnaz avatar Jun 09 '18 21:06 Zurnaz

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

rafifajar22 avatar Jul 24 '18 10:07 rafifajar22

#32

JlnWntr avatar Dec 03 '18 18:12 JlnWntr