共用方式為


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

取得或設定 藍牙LEAdvertisementFilter 物件,用於設定使用承載區段型篩選的藍牙 LE 公告篩選。

AllowExtendedAdvertisements

使用擴充廣告格式啟用廣告的接收。 預設為 False。

MaxOutOfRangeTimeout

取得超出範圍的逾時上限。

MaxSamplingInterval

取得取樣間隔上限。

MinOutOfRangeTimeout

取得超出範圍的最小逾時。

MinSamplingInterval

取得最小取樣間隔。

ScanningMode

取得或設定藍牙 LE 掃描模式。

ScanParameters

接收藍牙低能源 (LE) 廣告的物件。

SignalStrengthFilter

取得或設定 藍牙SignalStrengthFilter 物件,用於設定使用訊號強度型篩選的藍牙 LE 廣告篩選。

Status

取得 BluetoothLEAdvertisementWatcher的目前狀態。

UseCodedPhy

接收藍牙低能源 (LE) 廣告的物件。

UseHardwareFilter

接收藍牙低能源 (LE) 廣告的物件。

UseUncoded1MPhy

接收藍牙低能源 (LE) 廣告的物件。

方法

Start()

啟動 BluetoothLEAdvertisementWatcher 以掃描藍牙 LE 廣告。

Stop()

停止 BluetoothLEAdvertisementWatcher ,並停用藍牙 LE 廣告的掃描。

事件

Received

收到新藍牙 LE 公告事件的通知。

Stopped

通知應用程式,指出藍牙 LE 掃描廣告已由應用程式取消或中止,或因錯誤而中止。

適用於

另請參閱