Simplify Android device lookup

This commit is contained in:
Morten Nielsen 2020-08-31 21:55:55 -07:00
parent 3ec22441e0
commit 181ec99341

View file

@ -54,7 +54,7 @@ namespace NmeaParser
var adapter = Android.Bluetooth.BluetoothAdapter.DefaultAdapter;
if (adapter != null && adapter.IsEnabled)
{
foreach (var b in adapter.BondedDevices.Where(d => d.GetUuids().Where(t => t.Uuid != null && t.Uuid.ToString()!.Equals("00001101-0000-1000-8000-00805F9B34FB", StringComparison.InvariantCultureIgnoreCase)).Any()))
foreach (var b in adapter.BondedDevices.Where(d => d.GetUuids().Any(t => SERIAL_UUID.CompareTo(t.Uuid) == 0)))
yield return b;
}
}