Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

modbt: Add async_connect (wip, needs testing) #124

Closed

Conversation

semireg
Copy link

@semireg semireg commented Jan 16, 2018

Adds non-blocking async_connect method to modbt. The Bluetooth callback SERVER_ASYNC_CONNECTED is called for each async connection. Async connections can be cancelled by disconnecting before being connected.

Edge cases exist:
• Multiple connections have not been tested.
• Coexistence with the blocking counterparts, connect(), have been minimally tested.
• A cancelled async connection still tries to connect, and when successful, immediately disconnects.
• Connection failures were not tested

I have left printfs in the pull request to aide in further testing.

Cross-posted in the forum at https://forum.pycom.io/topic/2460/ble-features-non-blocking-connects-char-presentation-format.

@husigeza
Copy link
Contributor

husigeza commented Aug 7, 2018

Hello,
As the proposed implementation breaks the structure and contains the hack for the mentioned case I close this PR as similar functionality/workaround exists when you place the connect() into a separate thread. Moreover in the future (will be contained by the next development version) the connect() method will get a timeout parameter which can be used to wait for only the specified time to connect.

@husigeza husigeza closed this Aug 7, 2018
peter-pycom added a commit that referenced this pull request Jun 10, 2020
X-Ryl669 pushed a commit to X-Ryl669/pycom-micropython-sigfox that referenced this pull request May 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants