FWeissenb
FWeissenb
If I try your code it doesn't seem to work. Display is only on if I hold the button. Do we need some software delay because of the button polling?
If I increase the debounce value to 300 µsec it works. I would also handle the screen_timeout within the switch method. Atm you make a timeout_clear within the switch method...
Thanks @jeanbaptistelab for this PR. In iOS we not only have timeout exceptions but also "peripheral not found"- platform exceptions. So can you include an general catch in your PR?...
@jeanbaptistelab Why did you remove the disconnect? I think its the same as the timeout. It's necessary to clean up and retry the connect method.
If I try this without disconnect it doesn't work in my application :/
My scenario: 1. search device, 2. safe UUID, 3. disconnect device and restart the app. Then I make a scan to get peripherals and try to connect with saved UUID...
Thanks :) LGTM @pauldemarco Can you merge this, please?
@jeanbaptistelab I have some problems with this code. Reproduce with android: 1. call connect when the device isn't switched on --> invokeMethod is called and we get first then branch...
With iOS this error didn't occured because there we get a platform exception with peripheral not found which is handled in catchError and don't reach the first then statement.
I have a counter proposal that is a lillte bit less complex ``` Future connect({ Duration timeout, bool autoConnect = true, }) async { Completer res = Completer(); var request...