BluetoothLEAdvertisementWatcher 类

定义

用于接收蓝牙低功耗 (LE) 广告的对象。

public ref class BluetoothLEAdvertisementWatcher sealed
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Activatable(Windows.Devices.Bluetooth.Advertisement.IBluetoothLEAdvertisementWatcherFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class BluetoothLEAdvertisementWatcher final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(Windows.Devices.Bluetooth.Advertisement.IBluetoothLEAdvertisementWatcherFactory, 65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class BluetoothLEAdvertisementWatcher final
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Devices.Bluetooth.Advertisement.IBluetoothLEAdvertisementWatcherFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class BluetoothLEAdvertisementWatcher
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Devices.Bluetooth.Advertisement.IBluetoothLEAdvertisementWatcherFactory), 65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class BluetoothLEAdvertisementWatcher
function BluetoothLEAdvertisementWatcher(advertisementFilter)
Public NotInheritable Class BluetoothLEAdvertisementWatcher
继承
Object Platform::Object IInspectable BluetoothLEAdvertisementWatcher
属性

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)
应用功能
bluetooth

注解

版本历史记录

Windows 版本 SDK 版本 增值
2004 19041 AllowExtendedAdvertisements

构造函数

BluetoothLEAdvertisementWatcher()

创建新的 BluetoothLEAdvertisementWatcher 对象。

BluetoothLEAdvertisementWatcher(BluetoothLEAdvertisementFilter)

使用广告筛选器创建新的 BluetoothLEAdvertisementWatcher 对象,以初始化观察程序。

属性

AdvertisementFilter

获取或设置一个 BluetoothLEAdvertisementFilter 对象,该对象用于配置使用基于有效负载部分的筛选的蓝牙 LE 播发筛选。

AllowExtendedAdvertisements

允许使用扩展广告格式接收广告。 默认为 False。

MaxOutOfRangeTimeout

获取最大范围外超时值。

MaxSamplingInterval

获取最大采样间隔。

MinOutOfRangeTimeout

获取最小范围外超时值。

MinSamplingInterval

获取最小采样间隔。

ScanningMode

获取或设置蓝牙 LE 扫描模式。

ScanParameters

用于接收蓝牙低功耗 (LE) 广告的对象。

SignalStrengthFilter

获取或设置一个 BluetoothSignalStrengthFilter 对象,该对象用于配置使用基于信号强度的筛选的蓝牙 LE 播发筛选。

Status

获取 BluetoothLEAdvertisementWatcher 的当前状态。

UseCodedPhy

用于接收蓝牙低功耗 (LE) 广告的对象。

UseHardwareFilter

用于接收蓝牙低功耗 (LE) 广告的对象。

UseUncoded1MPhy

用于接收蓝牙低功耗 (LE) 广告的对象。

方法

Start()

启动 BluetoothLEAdvertisementWatcher 以扫描蓝牙 LE 广告。

Stop()

停止 BluetoothLEAdvertisementWatcher 并禁用蓝牙 LE 广告的扫描。

事件

Received

收到新的蓝牙 LE 播发事件的通知。

Stopped

向应用发送通知,告知应用已取消或中止蓝牙 LE 扫描广告或因错误而中止。

适用于

另请参阅