Michael Gabbay
Michael Gabbay

Reputation: 465

Error getting ble device services using FromBluetoothAddressAsync

edit

it's A known problem with some microsoft security issue https://social.msdn.microsoft.com/Forums/en-US/58da3fdb-a0e1-4161-8af3-778b6839f4e1/bluetooth-bluetoothledevicefromidasync-does-not-complete-on-10015063?forum=wdk

adding registery CoInitializeSecurity values as mentioned fixed the problem!

i'm trying to read A BLE device services using An Advertisment watcher. i've implemnted the service read inside the listenter, the Code:

   private async void OnAdvertisementReceived(BluetoothLEAdvertisementWatcher watcher, BluetoothLEAdvertisementReceivedEventArgs args)
    {

        if (!gotSignal)
        {
            gotSignal = true;
            device = await Windows.Devices.Bluetooth.BluetoothLEDevice.FromBluetoothAddressAsync(args.BluetoothAddress);
            service = await GattDeviceService.FromIdAsync(device.DeviceId);

        }
          ...
     }

the problem is that I can't get the BluetoothLEDevice object, when I reach this line, it is not getting back any value and it skips the next lines inside the listener. NOTE: I've installed windows creators update and before the installation, the function BluetoothLEDevice.FromBluetoothAddressAsync has worked.

Upvotes: 1

Views: 1017

Answers (1)

Michael Gabbay
Michael Gabbay

Reputation: 465

Solution

it's A known problem with some microsoft security issue https://social.msdn.microsoft.com/Forums/en-US/58da3fdb-a0e1-4161-8af3-778b6839f4e1/bluetooth-bluetoothledevicefromidasync-does-not-complete-on-10015063?forum=wdk

adding registery CoInitializeSecurity values as mentioned fixed the problem!

Upvotes: 1

Related Questions