Пример #1
0
        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);
        }
Пример #2
0
 public static byte[] GetManufacturerSpecificData(this BluetoothLEAdvertisement adv)
 => adv.GetSectionDataOrNull(BluetoothLEAdvertisementDataTypes.ManufacturerSpecificData);
Пример #3
0
        public static sbyte GetTxPower(this BluetoothLEAdvertisement adv)
        {
            var data = adv.GetSectionDataOrNull(BluetoothLEAdvertisementDataTypes.TxPowerLevel);

            return(data == null ? (sbyte)0 : (sbyte)data[0]);
        }