From 4aa08267ffcfb5bc0b70eecceedf99d7a423812d Mon Sep 17 00:00:00 2001 From: Ivan P <25914822+userepo@users.noreply.github.com> Date: Wed, 1 Jul 2026 22:08:53 -0500 Subject: [PATCH] winrtble: also receive on the Coded PHY where supported 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. --- src/winrtble/ble/watcher.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/winrtble/ble/watcher.rs b/src/winrtble/ble/watcher.rs index 59881ccb..9bea6888 100644 --- a/src/winrtble/ble/watcher.rs +++ b/src/winrtble/ble/watcher.rs @@ -48,6 +48,11 @@ impl BLEWatcher { self.watcher .SetScanningMode(BluetoothLEScanningMode::Active)?; let _ = self.watcher.SetAllowExtendedAdvertisements(true); + // Also receive on the Coded (long-range) PHY where the adapter and + // OS support it. Only takes effect alongside extended advertisements + // (above); the error is ignored the same way, so systems without + // Coded PHY support behave exactly as before. + let _ = self.watcher.SetUseCodedPhy(true); // Pre-convert the filter UUIDs once so the handler closure is cheap. let filter_guids: Vec = services.iter().map(utils::to_guid).collect();