BluetoothSignalStrengthFilter 類別

定義

將用來設定接收訊號強度指標的參數分組, (RSSI) 型篩選。

public ref class BluetoothSignalStrengthFilter sealed
/// [Windows.Foundation.Metadata.Activatable(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 BluetoothSignalStrengthFilter 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(65536, "Windows.Foundation.UniversalApiContract")]
class BluetoothSignalStrengthFilter final
[Windows.Foundation.Metadata.Activatable(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 BluetoothSignalStrengthFilter
[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(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class BluetoothSignalStrengthFilter
function BluetoothSignalStrengthFilter()
Public NotInheritable Class BluetoothSignalStrengthFilter
繼承
Object Platform::Object IInspectable BluetoothSignalStrengthFilter
屬性

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

備註

BluetoothSignalStrengthFilter 類別只接受其屬性的有限範圍。 不過,視應用程式使用此類別的方式而定,可能會套用額外的限制。 例如,RSSI 值的有效範圍在藍牙 LE 和藍牙 BR/EDR 裝置之間有所不同。

這些屬性的有效範圍如下:

  • InRangeThresholdInDBm - 要納入範圍內的 RSSI 事件閾值下限。 有效範圍是 -128 到 127。
  • OutOfRangeThresholdInDBm - 要視為超出範圍的 RSSI 事件最小閾值。 有效範圍是 -128 到 127。
  • OutOfRangeTimeout - 將 RSSI 事件視為超出範圍的逾時。 有效範圍等於或大於 1 秒。
  • SamplingInterval - RSSI 事件取樣的間隔。 有效範圍等於或大於 0。 任何大於或等於 25.5 秒的取樣間隔都會完全停用取樣。 在該特殊情況下,篩選是以觸發程式為基礎。 篩選任何裝置的 RSSI 值有兩種可能的狀態:
  • 在範圍內。
  • 超出範圍。 如果 RSSI 事件在範圍中被視為,則會傳播這些事件。 這包括 RSSI 值低於或等於 OutOfRangeThresholdInDBm 的事件,只要 OutOfRangeTimeout 尚未過期。

BluetoothLEAdvertisementWatcher 類別使用時,此類別對其屬性有額外的限制。 當 BluetoothLEAdvertisementWatcher藍牙AdvertisementWatcher的有效範圍以外的參數啟動時,將會擲回例外狀況。

一般而言,此 API 有三個主要使用案例:

InRangeThresholdInDBm OutOfRangeThresholdInDBm OutOfRangeTimeout SamplingInterval 行為
任意 <= InRangeThresholdInDBm >= 1 0 只要將其視為「範圍」,就會收到所有 RSSI 事件。 如果 OutOfRangeTimeout 沒有任何事件或 RSSI 值大於 OutOfRangeThresholdInDBm的事件過期,則事件會被視為「超出範圍」。 當 OutOfRangeTimeout到期時,不會產生其他事件。
任意 <= InRangeThresholdInDBm >= 1 (0,25.5) 只要將 RSSI 事件視為「範圍」,就會定期接收 SamplingInterval 所定義的 RSSI 事件。 RSSI 值將是 SamplingInterval內收到的事件值平均值。 如果在 SamplingInterval內未收到任何事件,則不會傳播任何事件。 如果 OutOfRangeTimeout 到期時沒有任何事件,或沒有 RSSI 值大於 OutOfRangeThresholdInDBm的任何事件,則事件會被視為「超出範圍」,而且將會產生最後一個收到 RSSI 值的事件。 如果最後一個 RSSI 值高於 OutOfRangeThresholdInDBm,則會設定為 -127 dBm。
任意 <= InRangeThresholdInDBm >= 1 >=25.5 (停用) 當 RSSI 事件從「超出範圍」轉換為「範圍」時,將會收到 RSSI 事件。 如果 OutOfRangeTimeout 到期時沒有任何事件,或沒有 RSSI 值大於 OutOfRangeThresholdInDBm的任何事件,則事件會被視為「超出範圍」,而且將會產生最後一個收到 RSSI 值的事件。 如果最後一個 RSSI 值高於 OutOfRangeThresholdInDBm,則會設定為 OutOfRangeThresholdInDBm

建構函式

BluetoothSignalStrengthFilter()

建立新的 BluetoothSignalStrengthFilter 物件。

屬性

InRangeThresholdInDBm

如果先前的事件被視為超出範圍,則接收的最小訊號強度指標 (RSSI) dBm 中將傳播 RSSI 事件或視為範圍中的值。

OutOfRangeThresholdInDBm

在 dBm 中,接收的訊號強度指標 (RSSI) 值,其中 RSSI 事件會被視為超出範圍。

OutOfRangeTimeout

收到訊號強度指標的逾時 (RSSI) 事件超出範圍。

SamplingInterval

接收訊號強度指標 (RSSI) 事件的間隔。

適用於

另請參閱