Search code examples
c#windowsbluetooth-lowenergy

BLE Scan Interval Windows 10 - DeviceIoControl return false with Last error: 1784 - ERROR_INVALID_USER_BUFFER


We need to tweak the BLE scan interval in windows 10 and found the solution in BLE Scan Interval Windows 10.

However when calling DeviceIoControl(handle, 0x41118c, ref req, 8, IntPtr.Zero, 0, out outsize, IntPtr.Zero); it always return false with the last error is 1784 - ERROR_INVALID_USER_BUFFER. And doesn't seems to affect the scan interval. Is there any suggestion to solve it please?


Solution

  • I faced the same issue. Resolved by adding some new registries item under this key: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Bluetooth\WinRT\BluetoothLEAdvertisementWatcher Add the following values: DWORD: ScanWindow, ScanInterval and adjust it to fit with your configuration.