Skip to content

Conversation

srgg
Copy link

@srgg srgg commented Oct 19, 2025

When Bluetooth is disabled mid-scan on macOS, CoreBluetooth stops delivering advertisements, causing the Scan() function to hang indefinitely waiting for context cancellation.

This update listens to the stateChanged event channel during scanning and exits the scan loop if the Bluetooth state changes to anything other than PoweredOn (e.g., PoweredOff).

When Bluetooth is disabled mid-scan on macOS, CoreBluetooth stops
delivering advertisements, causing the Scan() function to hang
indefinitely waiting for context cancellation.

This update listens to the stateChanged event channel during scanning
and exits the scan loop if the Bluetooth state changes to anything
other than PoweredOn (e.g., PoweredOff).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant