title: Use Windows BLE using c++
body: <p>I'm trying to use the BLE feature of the winodws 10 laptop. I've first used the c# based examples available <a href="https://github.com/Microsoft/Windows-universal-samples" rel="nofollow noreferrer">here</a> . I can use the laptop as a BLE peripheral mode as well as the server mode. Now I'd like to implement the same feature in c++. I've found that the API that I should use to implement this is found <a href="https://msdn.microsoft.com/en-us/library/windows/hardware/hh450825(v=vs.85).aspx" rel="nofollow noreferrer">here</a>.</p>
  
  <p>I followed <a href="https://social.msdn.microsoft.com/Forums/en-US/bad452cb-4fc2-4a86-9b60-070b43577cc9/is-there-a-simple-example-desktop-programming-c-for-bluetooth-low-energy-devices?forum=wdk" rel="nofollow noreferrer">this</a> example to implement an initial server mode in the windows 10 laptop computer. But I first need the peripheral mode and I tried to add the class ID of my BLE device found from the device manager. </p>
  
  <p><a href="https://i.stack.imgur.com/pmOg6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pmOg6.png" alt="enter image description here"></a></p>
  
  <p>But the <code>SetupDiEnumDeviceInterfaces</code> function fails with the error code 0x103 (No further information)</p>
  
  <pre><code>hDI = SetupDiGetClassDevs(&amp;BluetoothInterfaceGUID, NULL, NULL, DIGCF_PRESENT);
  if (hDI == INVALID_HANDLE_VALUE) return NULL;
  
  did.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
  dd.cbSize = sizeof(SP_DEVINFO_DATA);
  
  BOOL isComplete = SetupDiEnumDeviceInterfaces(hDI, NULL, &amp;BluetoothInterfaceGUID, 0, &amp;did);
  </code></pre>
  
  <p>Any idea why this call fails? Should I be using any other GUID instead of the class GUID?</p>