pycom / pycom-micropython-sigfox

A fork of MicroPython with the ESP32 port customized to run on Pycom's IoT multi-network modules.
MIT License
199 stars 167 forks source link

Enhancement: Bluetooth should have a timeout function for connect #36

Closed kutysam closed 6 years ago

kutysam commented 7 years ago

https://docs.pycom.io/chapter/firmwareapi/pycom/network/bluetooth/

bluetooth.connect(mac_addr) Opens a BLE connection with the device specified by the mac_addr argument. This function blocks until the connection succeeds or fails. If the connections succeeds it returns a object of type GATTCConnection. bluetooth.connect('112233eeddff') # mac address is accepted as a string

I have tried putting in a dummy MAC address and it takes 30 seconds to timeout.

I think it will be great if we can set our own timeout. e.g. bluetooth.connect('MAC',timeout)

husigeza commented 6 years ago

Hello,

Thanks for reporting, next development version will contain the requested feature.