Table of Contents

Class BluetoothLEAdvertisementPublisher

Namespace
nanoFramework.Device.Bluetooth.Advertisement
Assembly
nanoFramework.Device.Bluetooth.dll

The BluetoothLEAdvertisementPublisher class allows the configuration and advertising of a Bluetooth LE advertisement packet.

public class BluetoothLEAdvertisementPublisher
Inheritance
BluetoothLEAdvertisementPublisher
Inherited Members
Extension Methods

Constructors

BluetoothLEAdvertisementPublisher()

Creates a new BluetoothLEAdvertisementPublisher object.

public BluetoothLEAdvertisementPublisher()

BluetoothLEAdvertisementPublisher(BluetoothLEAdvertisement)

Creates a new BluetoothLEAdvertisementPublisher object with the Bluetooth LE advertisement to publish.

public BluetoothLEAdvertisementPublisher(BluetoothLEAdvertisement advertisement)

Parameters

advertisement BluetoothLEAdvertisement

The Bluetooth LE advertisement to publish.

Properties

Advertisement

Gets a copy of the Bluetooth LE advertisement to publish.

public BluetoothLEAdvertisement Advertisement { get; }

Property Value

BluetoothLEAdvertisement

IncludeTransmitPowerLevel

Specifies whether the transmit power level is included in the advertisement header. Defaults to False.

public bool IncludeTransmitPowerLevel { get; set; }

Property Value

bool

IsAnonymous

Specifies whether or not the device address is included in the advertisement header. By default, the address is included.

public bool IsAnonymous { get; set; }

Property Value

bool

PreferredTransmitPowerLevelInDBm

If specified, requests that the radio use the indicated transmit power level for the advertisement. Defaults to 0.

public short PreferredTransmitPowerLevelInDBm { get; set; }

Property Value

short

Status

Gets the current status of the BluetoothLEAdvertisementPublisher.

public BluetoothLEAdvertisementPublisherStatus Status { get; }

Property Value

BluetoothLEAdvertisementPublisherStatus

UseExtendedAdvertisement

Specifies that the advertisement publisher should use the Extended Advertising format. Defaults to False, use legacy advertisements. If Bluetooth 5.0 not available on target platform then a PlatformNotSupportedException will be thrown.

public bool UseExtendedAdvertisement { get; set; }

Property Value

bool

Methods

Start()

Start advertising a Bluetooth LE advertisement payload.

public void Start()

Stop()

Stop the publisher and stop advertising a Bluetooth LE advertisement payload.

public void Stop()

Events

StatusChanged

Notification that the status of the BluetoothLEAdvertisementPublisher has changed.

public event BluetoothLEAdvertisementPublisher.BluetoothLEAdvertisementPublisherHandler StatusChanged

Event Type

BluetoothLEAdvertisementPublisher.BluetoothLEAdvertisementPublisherHandler