Table of Contents

Interface IBluetoothAdvertisement

Namespace
Bluetooth.Abstractions.Scanning
Assembly
Bluetooth.Abstractions.Scanning.dll

Interface representing a Bluetooth advertisement, providing properties for accessing advertisement data received from a Bluetooth device.

public interface IBluetoothAdvertisement

Properties

BluetoothAddress

Gets the Bluetooth address of the device sending the Bluetooth LE advertisement. Android : ScanResult.Device?.Address iOS : Peripheral.Identifier.AsString() Windows : BluetoothLeAdvertisementReceivedEventArgs.BluetoothAddress

string BluetoothAddress { get; }

Property Value

string

DateReceived

A timestamp for the point in time in which each Advertisement was received.

DateTimeOffset DateReceived { get; }

Property Value

DateTimeOffset

DeviceName

Name of the device sending that advertisement. Android : ScanResult.ScanRecord?.DeviceName iOS : AdvertisementData.LocalName Windows : BluetoothLeAdvertisementReceivedEventArgs.Advertisement?.GetDeviceName()

string DeviceName { get; }

Property Value

string

IsConnectable

Indicates whether the received advertisement is connectable. Android : ScanResult.ScanRecord?.IsConnectable [not available prior to API 8.0 (API level 26)] iOS : AdvertisementData.IsConnectable Windows : BluetoothLeAdvertisementReceivedEventArgs.AdvertisementType is BluetoothLEAdvertisementType.ConnectableDirected or BluetoothLEAdvertisementType.ConnectableUndirected

bool IsConnectable { get; }

Property Value

bool

Manufacturer

Gets the Primary Manufacturer based on the "Manufacturer Data" sectors in BLE "Advertising-Messages" and BLE "Scan-Response-Messages".

Corresponds to the bytes [0] and [1] of the "Manufacturer Data" sector.

Manufacturer Manufacturer { get; }

Property Value

Manufacturer

ManufacturerData

Gets the BLE advertisement-payload-data that was received.

Note that this byte array is normalized to enforce same byte-layout across all platforms (iOS, Android, Windows).

This property has been introduced for the sake of backwards compatibility back in 2020 when the BLE library was being consolidated.

The byte-layout has been inspired by the one that iOS offers natively in its APIs:

[2 bytes of manufacturer-id in reserve order] [one byte of device-id] [... chunks of manufacturer-data here]

Note: Don't resort to byte-sniffing this byte-array unless maybe for debugging purposes. when it comes to this particular property these libs' maintainers can't and won't provide any guarantees in terms of compatibility.

ReadOnlyMemory<byte> ManufacturerData { get; }

Property Value

ReadOnlyMemory<byte>

ManufacturerId

Gets the ID of the manufacturer.

int ManufacturerId { get; }

Property Value

int

ServicesGuids

Gets the Bluetooth address of the device sending the Bluetooth LE advertisement. Android : ScanResult.ScanRecord?.ServiceUuids iOS : AdvertisementData.ServiceUuids Windows : BluetoothLeAdvertisementReceivedEventArgs.Advertisement?.GetServiceUuids()

IEnumerable<Guid> ServicesGuids { get; }

Property Value

IEnumerable<Guid>

SignalStrengthInDBm

Raw Signal Strength In DBm. Android : ScanResult.Rssi iOS : Rssi.Int32Value Windows : BluetoothLeAdvertisementReceivedEventArgs.RawSignalStrengthInDBm

int SignalStrengthInDBm { get; }

Property Value

int

TransmitPowerLevelInDBm

Represents the received transmit power of the advertisement. Android : ScanResult.ScanRecord?.TxPowerLevel iOS : AdvertisementData.TxPowerLevel?.Int32Value Windows : BluetoothLeAdvertisementReceivedEventArgs.Advertisement?.GetTxPower()

int TransmitPowerLevelInDBm { get; }

Property Value

int