Skip to content

fix(ble): start the Windows BLE receiver once Bluetooth is turned on - #96

Merged
asulwer merged 1 commit into
masterfrom
fix/ble-receiver-starts-with-bluetooth-off
Oct 28, 2026
Merged

asulwer merged 1 commit into
masterfrom
fix/ble-receiver-starts-with-bluetooth-off

Conversation

@asulwer

@asulwer asulwer commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Started with Bluetooth off, the receiver's GattServiceProvider::CreateAsync failed with RadioNotAvailable and the task ended, so the PC stayed undiscoverable to phones over BLE until the app was restarted. It now waits for the radio to be on, through the radio's StateChanged event, before creating the service. Linux already waited for the adapter to power on.

bluetooth_on() is bluetooth_turned_on() that also resolves at once when the radio is already on, so a radio that comes on between the check and the subscription isn't missed.

Started with Bluetooth off, the receiver's GattServiceProvider::CreateAsync failed with RadioNotAvailable and the task ended, so the PC stayed undiscoverable to phones over BLE until the app was restarted. It now waits for the radio to be on, through the radio's StateChanged event, before creating the service. Linux already waited for the adapter to power on.

bluetooth_on() is bluetooth_turned_on() that also resolves at once when the radio is already on, so a radio that comes on between the check and the subscription isn't missed.
@asulwer
asulwer merged commit 4c1a1c3 into master Oct 28, 2026
10 checks passed
@asulwer
asulwer deleted the fix/ble-receiver-starts-with-bluetooth-off branch October 28, 2026 19:10
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