winrtble: also receive on the Coded PHY where supported#463
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.
micro:bit advertises v1 frames on Coded S=8 and scans 1M + coded primaries; Windows does the same when the adapter supports it, detected at startup. Coded RX on Windows pins a patched btleplug fork until deviceplug/btleplug#463 ships. v0 legacy advertising is unchanged, so short messages keep universal reach.
|
Hi @qwandor, the Linux job on this PR is failing at the "Run clippy" step. Two things show up in the log:
The second part looks like the known actions-rs/clippy-check limitation on fork PRs (unmaintained action, no write access to post annotations from a fork). Is that expected/ignorable on this repo, or are there existing clippy findings on a target branch underneath causing the actual failure? |
|
It looks like there are a bunch of existing clippy warnings but they are unrelated to the change so you can ignore them for now. I think @qdot should review this though, I'm not very familiar with the Windows side. |
|
I'm actually around, I just gotta actually check my PR mail heh. Lemme see what we can do on this, since I also need to take a look at #465, see if I can bring tests for these into our embedded system, etc. |
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.