public async void StartScanningForDevices(params string[] serviceUuids) { DiscoveredDevices = new List(); IsScanning = true; List col = new List(); if (serviceUuids.Length < 1) { col.Add(await DeviceInformation.FindAllAsync()); } else { foreach (var id in serviceUuids) { col.Add(await DeviceInformation.FindAllAsync(GattDeviceService.GetDeviceSelectorFromUuid(id.ToGuid()))); } } for (int i = 0; i < col.ToArray().Length; i++) { foreach (DeviceInformation x in col[i].ToList()) { Device device = null; try { device = new Device(await Device.DeviceFromDeviceInfo(x)); DiscoveredDevices.Add(device); DeviceDiscovered(this, new DeviceDiscoveredEventArgs(device)); } catch (Exception e) { //throw new Exception(message:e.Message); } } } IsScanning = false; }