OpenBluetoothToolbox / SimpleBLE

SimpleBLE - the all-in-one Bluetooth library for MacOS, iOS, Windows, Linux and Android.
https://www.simpleble.org
Other
697 stars 116 forks source link

[Windows] SimpleBLE built for 32-bit targets always returns "Bluetooth not enabled" on 64-bit hosts #186

Open kdewald opened 1 year ago

kdewald commented 1 year ago

@eriklins I tried to replicate this issue locally but failed. Is there anything specific about your environment that could cause this problem?

GrahamNZ commented 1 year ago

I built the DLL files and the samples on a Win 11 PC as 32 bit. The example_list_adapters program shows my BLE adapter correctly and the example_scan program found devices.

Then I copied the fmt.dll, simpleble.dll, simple-c.dll and example_scan.exe files to my Win 10 PC (where the 64 bit version works fine, as does the nSoftware 32 bit BLE program) and it fails with a "Bluetooth is not enabled!" error. The Win 10 PC does not have VS, Git, Cmake or C++ installed.

kdewald commented 1 year ago

Found the cause of the problem delineated in https://learn.microsoft.com/en-us/uwp/api/windows.devices.radios.radio.getradiosasync?view=winrt-22621

image

kdewald commented 1 year ago

https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getnativesysteminfo