I have provided a small C++ prototype test code (80+ lines C++). (Visual Studio 2010 project)
The code prints names of available local hardware Bluetooth Radios in Windows 10. (physical bluetooth devices attached to the PC).
It works and prints the local bluetooth adapter names.
What is the problem?
The problem is when the Windows 10 Bluetooth setting is off. It will not find any attached Bluetooth radios/devices.
[login to view URL] shows the Windows 10 Bluetooth setting.
[login to view URL] top shows when Windows 10 Bluetooth setting is on
[login to view URL] bottom shows when Windows 10 Bluetooth setting is off.
What I need done?
I need at program start, check if Windows 10 Bluetooth Setting is on or off. If it is off then turn it on.
I.e. pseudo code:
if( Windows10 Bluetooth == Off )
Windows10 Bluetooth = On
1) New code to check if Windows 10 Bluetooth Setting is on.
2) New code to turn Windows 10 Bluetooth setting on/off.
3) It needs to stay as a C++ project (it will be included in a larger C++ project later)
4) New code must call standard windows10 code/API/lib/etc. No 3rd party or custom written closed exe/lib.
5) The code must work on any Windows 10 PC.
5.a) Do not hard code Bluetooth adapter device identifier like device name or device GUID - specific hardware cannot be referenced on another PC.
5.b) Do not reference Windows10 panel GUI's because MS might change this in future Windows Updates.
How to test done?
a) Turn Windows 10 Bluetooth Setting off via Settings panel.
b) Run program exe.
c) Check Windows 10 Bluetooth Setting is on in Settings Panel.
d) Program prints bluetooth radio (using C++ BluetoothFindFirstRadio/Next, BluetoothGetRadioInfo etc).
Solution Hint: It may be possible to set Windows 10 Bluetooth setting on by using:
1.a) C++ Win32 API.
1.b) command line System() C++ call.
1.c) UWP from C++ call.
1.d) a service (only a guess)
2) Other comments
2.a) The project builds using Visual Studio 2010 but feel free to upgrade it to a later version of Visual Studio or Express etc.
2.b) BluetoothAPIs.h file which came with Visual Studio 2010 has compile errors, I have provided fixed version of BluetoothAPIs.h you may need it.
feel free to ask questions or discuss