BluetoothLEAdvertisement BluetoothLEAdvertisement BluetoothLEAdvertisement BluetoothLEAdvertisement Class

Definition

A representation of a Bluetooth LE advertisement payload.

public : sealed class BluetoothLEAdvertisement : IBluetoothLEAdvertisementpublic sealed class BluetoothLEAdvertisement : IBluetoothLEAdvertisementPublic NotInheritable Class BluetoothLEAdvertisement Implements IBluetoothLEAdvertisement// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

This class is used to represent an advertisement received by the system, an advertisement pattern to filter for, or an advertisement payload that needs to be published. In the case it is generated by the system to represent an advertisement received, certain properties are automatically populated.

For more information about its usage, refer to BluetoothLEAdvertisementWatcher class for receiving advertisements and the BluetoothLEAdvertisementPublisher class for sending advertisements.

Constructors

BluetoothLEAdvertisement() BluetoothLEAdvertisement() BluetoothLEAdvertisement() BluetoothLEAdvertisement()

Creates a new BluetoothLEAdvertisement object.

public : BluetoothLEAdvertisement()public BluetoothLEAdvertisement()Public Sub New()// You can use this method in JavaScript.

Properties

DataSections DataSections DataSections DataSections

Gets the list of raw data sections.

public : IVector<BluetoothLEAdvertisementDataSection> DataSections { get; }public IList<BluetoothLEAdvertisementDataSection> DataSections { get; }Public ReadOnly Property DataSections As IList<BluetoothLEAdvertisementDataSection>// You can use this property in JavaScript.
Value
IVector<BluetoothLEAdvertisementDataSection> IList<BluetoothLEAdvertisementDataSection> IList<BluetoothLEAdvertisementDataSection> IList<BluetoothLEAdvertisementDataSection>

The list of raw data sections.

Remarks

When a BluetoothLEAdvertisement is generated by the system, the other properties are different representations of the sections contained within this list. As such, only the DataSections property needs to be copied when switching between the different usages.

Flags Flags Flags Flags

Bluetooth LE advertisement flags.

public : IReference<BluetoothLEAdvertisementFlags> Flags { get; set; }public Nullable<BluetoothLEAdvertisementFlags> Flags { get; set; }Public ReadWrite Property Flags As Nullable<BluetoothLEAdvertisementFlags>// You can use this property in JavaScript.
Value
IReference<BluetoothLEAdvertisementFlags> Nullable<BluetoothLEAdvertisementFlags> Nullable<BluetoothLEAdvertisementFlags> Nullable<BluetoothLEAdvertisementFlags>

Bluetooth LE advertisement flags.

LocalName LocalName LocalName LocalName

The local name contained within the advertisement.

public : PlatForm::String LocalName { get; set; }public string LocalName { get; set; }Public ReadWrite Property LocalName As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The local name contained within the advertisement. This property can be either the shortened or complete local name defined by the Bluetooth LE specifications.

ManufacturerData ManufacturerData ManufacturerData ManufacturerData

Gets the list of manufacturer-specific data sections in a BluetoothLEAdvertisement.

public : IVector<BluetoothLEManufacturerData> ManufacturerData { get; }public IList<BluetoothLEManufacturerData> ManufacturerData { get; }Public ReadOnly Property ManufacturerData As IList<BluetoothLEManufacturerData>// You can use this property in JavaScript.
Value
IVector<BluetoothLEManufacturerData> IList<BluetoothLEManufacturerData> IList<BluetoothLEManufacturerData> IList<BluetoothLEManufacturerData>

The list of manufacturer-specific data sections.

ServiceUuids ServiceUuids ServiceUuids ServiceUuids

The list of service UUIDs in 128-bit GUID format in a BluetoothLEAdvertisement.

public : IVector<Guid> ServiceUuids { get; }public IList<Guid> ServiceUuids { get; }Public ReadOnly Property ServiceUuids As IList<Guid>// You can use this property in JavaScript.
Value
IVector<PlatForm::Guid> IList<Guid> IList<Guid> IList<Guid>

The list of service UUIDs in 128-bit GUID format. This property aggregates all the 16-bit, 32-bit and 128-bit service UUIDs into a single list.

Methods

GetManufacturerDataByCompanyId(UInt16) GetManufacturerDataByCompanyId(UInt16) GetManufacturerDataByCompanyId(UInt16) GetManufacturerDataByCompanyId(UInt16)

Return a list of all manufacturer data sections in the BluetoothLEAdvertisement payload matching the specified company ID.

public : IVectorView<BluetoothLEManufacturerData> GetManufacturerDataByCompanyId(unsigned short companyId)public IReadOnlyList<BluetoothLEManufacturerData> GetManufacturerDataByCompanyId(UInt16 companyId)Public Function GetManufacturerDataByCompanyId(companyId As UInt16) As IReadOnlyList( Of BluetoothLEManufacturerData )// You can use this method in JavaScript.
Parameters
companyId
unsigned short UInt16 UInt16 UInt16

The company identifier code defined by the Bluetooth Special Interest Group (SIG).

Returns
IVectorView<BluetoothLEManufacturerData> IReadOnlyList<BluetoothLEManufacturerData> IReadOnlyList<BluetoothLEManufacturerData> IReadOnlyList<BluetoothLEManufacturerData>

A vector of BluetoothLEManufacturerData contained within the payload.

GetSectionsByType(Byte) GetSectionsByType(Byte) GetSectionsByType(Byte) GetSectionsByType(Byte)

Return a list of advertisement data sections that matches a given advertisement section type in a BluetoothLEAdvertisement.

public : IVectorView<BluetoothLEAdvertisementDataSection> GetSectionsByType(Byte type)public IReadOnlyList<BluetoothLEAdvertisementDataSection> GetSectionsByType(Byte type)Public Function GetSectionsByType(type As Byte) As IReadOnlyList( Of BluetoothLEAdvertisementDataSection )// You can use this method in JavaScript.
Parameters
type
Byte Byte Byte Byte

The advertisement section type

Returns
IVectorView<BluetoothLEAdvertisementDataSection> IReadOnlyList<BluetoothLEAdvertisementDataSection> IReadOnlyList<BluetoothLEAdvertisementDataSection> IReadOnlyList<BluetoothLEAdvertisementDataSection>

A vector of all the BluetoothLEAdvertisementDataSection matching the given advertisement type. This method returns an empty list if no such sections are found in the payload.