public static string GetDeviceName(this BluetoothLEAdvertisement adv) { var data = adv.GetSectionDataOrNull(BluetoothLEAdvertisementDataTypes.CompleteLocalName); if (data == null) { return(adv.LocalName); } var name = Encoding.UTF8.GetString(data); return(name); }
public static byte[] GetManufacturerSpecificData(this BluetoothLEAdvertisement adv) => adv.GetSectionDataOrNull(BluetoothLEAdvertisementDataTypes.ManufacturerSpecificData);
public static sbyte GetTxPower(this BluetoothLEAdvertisement adv) { var data = adv.GetSectionDataOrNull(BluetoothLEAdvertisementDataTypes.TxPowerLevel); return(data == null ? (sbyte)0 : (sbyte)data[0]); }