winrtble: also receive on the Coded PHY where supported#463
Open
userepo wants to merge 1 commit into
Open
Conversation
Extended advertisements are already enabled unconditionally via SetAllowExtendedAdvertisements with the error ignored; enable UseCodedPhy the same way, so coded-primary (long range) BLE 5 advertisements are received on adapters that support them. On systems without Coded PHY support the call fails and is ignored, leaving behavior unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
One line in
BLEWatcher::start: enableUseCodedPhy(true)on theBluetoothLEAdvertisementWatcher, next to the existing unconditionalSetAllowExtendedAdvertisements(true)and with the same error-ignoredpattern.
Why
Without it, the Windows backend never receives BLE 5 coded-primary
(long range) advertisements, even on adapters that support them.
Extended advertisements are announced on the primary channels using
either the 1M or the Coded PHY (2M is secondary-channel-only, and the
controller follows AUX pointers to any secondary PHY automatically);
AllowExtendedAdvertisementsalone leaves the scanner listening on 1Mprimaries only.
UseCodedPhyis documented to take effect onlyalongside
AllowExtendedAdvertisements, which this watcher alreadysets, so this completes the pair.
The call fails harmlessly on systems without Coded PHY support (older
Windows builds / non-coded adapters); the error is ignored exactly like
the extended flag above it, so behavior there is unchanged. On supported
systems, 1M reception is unaffected — coded scanning is additive.