頻道監控
該模塊包括用於通道監視功能的功能。
概要
啟用通道監視器功能( OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE
)時,此模塊中的功能可用。
頻道監視將定期監視所有頻道,以幫助確定較乾淨的頻道(干擾較小的頻道)。
當通道監視處於活動狀態時,將執行零持續時間的能量掃描,並在每個採樣間隔的每個通道上收集單個RSSI採樣。將RSSI樣本與預先指定的RSSI閾值進行比較。作為信道質量的指標,信道監視模塊維護並提供在(大約)指定樣本窗口(稱為信道佔用率)內高於閾值的RSSI樣本的平均速率/百分比。
職能 | |
---|---|
otChannelMonitorGetChannelOccupancy ( otInstance *aInstance, uint8_t aChannel) | uint16_t 獲取給定頻道的當前頻道佔用率。 |
otChannelMonitorGetRssiThreshold ( otInstance *aInstance) | int8_t 獲取以dBm為單位的信道監視RSSI閾值。 |
otChannelMonitorGetSampleCount ( otInstance *aInstance) | uint32_t 獲取通道監視的RSSI樣本總數(每個通道)。 |
otChannelMonitorGetSampleInterval ( otInstance *aInstance) | uint32_t 獲取通道監視採樣間隔(以毫秒為單位)。 |
otChannelMonitorGetSampleWindow ( otInstance *aInstance) | uint32_t 獲取平均樣本窗口長度(樣本數)的通道監視。 |
otChannelMonitorIsEnabled ( otInstance *aInstance) | bool 此功能指示通道監視操作是否已啟用並正在運行。 |
otChannelMonitorSetEnabled ( otInstance *aInstance, bool aEnabled) | 此功能啟用/禁用通道監視操作。 |
職能
otChannelMonitorGetChannelOccupancy
uint16_t otChannelMonitorGetChannelOccupancy( otInstance *aInstance, uint8_t aChannel )
獲取給定頻道的當前頻道佔用率。
信道佔用率值表示高於RSSI閾值的RSSI樣本(“不良” RSSI樣本)的平均速率/百分比。
對於第一個“樣本窗口”樣本,平均值保持為實際百分比(即“不良”樣本數與樣本總數之比)。在“窗口”樣本之後,平均器將使用指數加權移動平均值。實際上,這意味著平均值代表最多3 * window
末尾樣本,而最新kSampleWindow
樣本的權重最高。
最大值0xffff
表示所有RSSI樣本均高於RSSI閾值(即100%的樣本為“不良”)。
細節 | |||||
---|---|---|---|---|---|
參量 |
| ||||
退貨 | 給定頻道的當前頻道佔用率。 |
otChannelMonitorGetRssiThreshold
int8_t otChannelMonitorGetRssiThreshold( otInstance *aInstance )
獲取以dBm為單位的信道監視RSSI閾值。
細節 | |||
---|---|---|---|
參量 |
| ||
退貨 | RSSI閾值,以dBm為單位。 |
otChannelMonitorGetSampleCount
uint32_t otChannelMonitorGetSampleCount( otInstance *aInstance )
獲取通道監視的RSSI樣本總數(每個通道)。
該計數指示自通道監視模塊啟動以來每個通道的總採樣數(自啟用Thread網絡接口以來)。
細節 | |||
---|---|---|---|
參量 |
| ||
退貨 | 到目前為止(每個通道)的RSSI樣本總數。 |
otChannelMonitorGetSampleInterval
uint32_t otChannelMonitorGetSampleInterval( otInstance *aInstance )
獲取通道監視採樣間隔(以毫秒為單位)。
細節 | |||
---|---|---|---|
參量 |
| ||
退貨 | 通道監視器採樣間隔(以毫秒為單位)。 |
otChannelMonitorGetSampleWindow
uint32_t otChannelMonitorGetSampleWindow( otInstance *aInstance )
獲取平均樣本窗口長度(樣本數)的通道監視。
細節 | |||
---|---|---|---|
參量 |
| ||
退貨 | 平均樣本窗口。 |
otChannelMonitorIsEnabled
bool otChannelMonitorIsEnabled( otInstance *aInstance )
此功能指示通道監視操作是否已啟用並正在運行。
細節 | |||
---|---|---|---|
參量 |
| ||
退貨 | 如果啟用了通道監視操作,則為TRUE,否則為FALSE。 |
otChannelMonitorSetEnabled
otError otChannelMonitorSetEnabled( otInstance *aInstance, bool aEnabled )
此功能啟用/禁用通道監視操作。
操作開始後,將清除以前收集的所有數據。但是,禁用操作後,先前收集的數據仍然有效並且可以讀取。
細節 | |||||
---|---|---|---|---|---|
參量 |
| ||||
返回值 |
|