OpenBluetoothToolbox / SimpleBLE

SimpleBLE - the all-in-one Bluetooth library for MacOS, iOS, Windows, Linux and Android.
https://www.simpleble.org
Other
655 stars 110 forks source link

[MacOS] Add timeout to connect #258

Closed BlissChapman closed 11 months ago

BlissChapman commented 11 months ago

Corebluetooth docs: Attempts to connect to a peripheral don't time out. SimpleBLE should expose a connectWithTimeout method to handle this flow gracefully for the consumer.

kdewald commented 11 months ago

@Andrey1994 this will probably also fix the issues that you saw.

Andrey1994 commented 11 months ago

Yes, I saw this PR, thanks! At least should not hang in deadlock, and maybe will solve the issue completly

kdewald commented 11 months ago

I'm quite mad that I missed that detail in the documentation. Given that they have callbacks for failed connections, it seems dumb that the user has to manually implement their own timeout logic.