0

I have a problem with Bluetooth pairing in the windows UWP device driver. I am currently on a windows 10 (Build 10240) computer and I use a vs2015. I create a device watcher with a (custom)selector to get paired and unpaired Bluetooth devices. I get all the Bluetooth devices in range. When i try to get the DeviceInformationCustomPairing of a device by the Pairing Property the pairing property is always null.

  private void DeviceWatcher_EnumerationCompleted(DeviceWatcher sender, object args)
    {
        var device = devices.Where(x => x?.Name != null && x.Name == name).FirstOrDefault();
        if (device != null)
        {
            DeviceInformationCustomPairing customPairing = device.Pairing.Custom;
Paul R
  • 208,748
  • 37
  • 389
  • 560
dkeekstra
  • 1
  • 1
  • I have tested this with official [code sample](https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/DeviceEnumerationAndPairing) scenario 9 . Unfortunately, I could not reproduce it. Please check your device if has hardware failure. – Nico Zhu Feb 28 '18 at 06:22
  • It is possible to pair and communicate with the Bluetooth devices trough window settings pairing. Today I tried the code on another pc with windows 10 Build 10586 and there the pairing object wasn't null. – dkeekstra Feb 28 '18 at 07:40
  • So, your code is correct. You could check your operating system which can't run the code well. – Nico Zhu Feb 28 '18 at 08:04
  • It's windows 10 Build 10240. I couldn't find the problem as a known bug. I cant update the machine because of company's policy. – dkeekstra Feb 28 '18 at 11:35

0 Answers0