getsenic / gatt-python

Bluetooth GATT SDK for Python
MIT License
318 stars 86 forks source link

Added timeout-option/parameter to start_discovery(...) #45

Open JlnWntr opened 5 years ago

JlnWntr commented 5 years ago

I had to re-open this pull-request, because I deleted my first fork of gatt-python. I'm sorry for that.

But I've now implemented blumberg's suggestion.

mdxs commented 4 years ago

Would it be an idea to have the default of 10 sec (10000 ms) in the function when the timeout parameter is missing? So that when it is not explicitly provided, that 10 sec is used; then the explicit option added in the "using" call could be omitted. If acceptable, perhaps an explicit 0 would have it not timeout, meaning that when timeout=0 is provided as parameter input, the discovery keeps on running (which is what I understand happened before this PR).

jlusiardi commented 4 years ago

I agree with @mdxs and go for a default timeout of 10s. It should also be documented what a value of None means for the timeout.