頻道管理員
該模塊包括通道管理器的功能。
概要
啟用通道管理器功能( OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
)後,此模塊中的功能可用。通道管理器僅在FTD構建上可用。
職能 | |
---|---|
otChannelManagerGetAutoChannelSelectionEnabled ( otInstance *aInstance) | bool 此功能指示是否啟用了自動頻道選擇功能。 |
otChannelManagerGetAutoChannelSelectionInterval ( otInstance *aInstance) | uint32_t 此功能獲取自動頻道選擇功能使用的周期間隔(以秒為單位)。 |
otChannelManagerGetDelay ( otInstance *aInstance) | uint16_t 此功能獲取頻道管理器用於頻道更改的延遲(以秒為單位)。 |
otChannelManagerGetFavoredChannels ( otInstance *aInstance) | uint32_t 此功能獲得首選的通道掩碼。 |
otChannelManagerGetRequestedChannel ( otInstance *aInstance) | uint8_t 此函數將通道從上次成功調用獲取到 otChannelManagerRequestChannelChange() |
otChannelManagerGetSupportedChannels ( otInstance *aInstance) | uint32_t 此功能獲取受支持的通道掩碼。 |
otChannelManagerRequestChannelChange ( otInstance *aInstance, uint8_t aChannel) | void 此功能請求更改線程網絡通道。 |
otChannelManagerRequestChannelSelect ( otInstance *aInstance, bool aSkipQualityCheck) | 此功能要求 ChannelManager 檢查並選擇一個新頻道並開始更改頻道。 |
otChannelManagerSetAutoChannelSelectionEnabled ( otInstance *aInstance, bool aEnabled) | void 此功能啟用/禁用自動頻道選擇功能。 |
otChannelManagerSetAutoChannelSelectionInterval ( otInstance *aInstance, uint32_t aInterval) | 此功能設置自動頻道選擇功能使用的時間間隔(以秒為單位)。 |
otChannelManagerSetDelay ( otInstance *aInstance, uint16_t aDelay) | 此功能設置用於頻道更改的延遲(以秒為單位)。 |
otChannelManagerSetFavoredChannels ( otInstance *aInstance, uint32_t aChannelMask) | void 此功能設置首選的通道掩碼。 |
otChannelManagerSetSupportedChannels ( otInstance *aInstance, uint32_t aChannelMask) | void 此功能設置支持的通道掩碼。 |
職能
otChannelManagerGetAutoChannelSelectionEnabled
bool otChannelManagerGetAutoChannelSelectionEnabled( otInstance *aInstance )
此功能指示是否啟用了自動頻道選擇功能。
細節 | |||
---|---|---|---|
參量 |
| ||
退貨 | 如果啟用則為TRUE,如果禁用則為FALSE。 |
otChannelManagerGetAutoChannelSelectionInterval
uint32_t otChannelManagerGetAutoChannelSelectionInterval( otInstance *aInstance )
此功能獲取自動頻道選擇功能使用的周期間隔(以秒為單位)。
細節 | |||
---|---|---|---|
參量 |
| ||
退貨 | 時間間隔(以秒為單位)。 |
otChannelManagerGetDelay
uint16_t otChannelManagerGetDelay( otInstance *aInstance )
此功能獲取頻道管理器用於頻道更改的延遲(以秒為單位)。
細節 | |||
---|---|---|---|
參量 |
| ||
退貨 | 頻道更改的延遲(以秒為單位)。 |
otChannelManagerGetFavoredChannels
uint32_t otChannelManagerGetFavoredChannels( otInstance *aInstance )
此功能獲得首選的通道掩碼。
細節 | |||
---|---|---|---|
參量 |
| ||
退貨 | 首選通道用作位掩碼。 |
otChannelManagerGetRequestedChannel
uint8_t otChannelManagerGetRequestedChannel( otInstance *aInstance )
此函數將通道從上次成功調用獲取到otChannelManagerRequestChannelChange()
細節 | |
---|---|
退貨 | 最後請求的頻道;如果還沒有頻道更改請求,則為零。 |
otChannelManagerGetSupportedChannels
uint32_t otChannelManagerGetSupportedChannels( otInstance *aInstance )
此功能獲取受支持的通道掩碼。
細節 | |||
---|---|---|---|
參量 |
| ||
退貨 | 支持的通道作為位掩碼。 |
otChannelManagerRequestChannelChange
void otChannelManagerRequestChannelChange( otInstance *aInstance, uint8_t aChannel )
此功能請求更改線程網絡通道。
在指定的延遲後,網絡將切換到給定的通道(請參閱otChannelManagerSetDelay() )。通過更新待處理操作數據集來執行頻道更改。
對該函數的後續調用將取消正在進行的先前請求的頻道更改。
細節 | |||||
---|---|---|---|---|---|
參量 |
|
otChannelManagerRequestChannelSelect
otError otChannelManagerRequestChannelSelect( otInstance *aInstance, bool aSkipQualityCheck )
此功能要求ChannelManager
檢查並選擇一個新頻道並開始更改頻道。
與otChannelManagerRequestChannelChange()
必須將通道作為參數)不同,此函數要求ChannelManager
自行選擇通道(基於收集的通道質量信息)。
調用後,渠道管理器將執行以下3個步驟:
1) ChannelManager
決定頻道更改是否有幫助。如果aSkipQualityCheck
設置為true,則可以跳過此檢查(強制進行通道選擇並跳過質量檢查)。此步驟使用設備上收集的鏈路質量度量(例如CCA故障率,每個鄰居的幀和消息錯誤率等)來確定當前信道質量是否處於可證明信道更改合理的水平。
2)如果第一步通過,則ChannelManager
選擇一個可能更好的頻道。它使用ChannelMonitor
模塊收集的信道質量數據。在此步驟中使用受支持和受支持的頻道。 (請參閱otChannelManagerSetSupportedChannels()和otChannelManagerSetFavoredChannels() )。
3)如果新選擇的通道與當前通道不同,則ChannelManager
請求/啟動通道更改過程(內部調用RequestChannelChange()
)。
細節 | |||||
---|---|---|---|---|---|
參量 |
| ||||
返回值 |
|
otChannelManagerSetAutoChannelSelectionEnabled
void otChannelManagerSetAutoChannelSelectionEnabled( otInstance *aInstance, bool aEnabled )
此功能啟用/禁用自動頻道選擇功能。
啟用後, ChannelManager
將定期調用RequestChannelSelect(false)
。可以通過SetAutoChannelSelectionInterval()
設置週期間隔。
細節 | |||||
---|---|---|---|---|---|
參量 |
|
otChannelManagerSetAutoChannelSelectionInterval
otError otChannelManagerSetAutoChannelSelectionInterval( otInstance *aInstance, uint32_t aInterval )
此功能設置自動頻道選擇功能使用的時間間隔(以秒為單位)。
細節 | |||||
---|---|---|---|---|---|
參量 |
| ||||
返回值 |
|
otChannelManagerSetDelay
otError otChannelManagerSetDelay( otInstance *aInstance, uint16_t aDelay )
此功能設置用於頻道更改的延遲(以秒為單位)。
延遲最好應大於線程網絡內所有睡眠終端設備使用的最大數據輪詢間隔。
細節 | |||||
---|---|---|---|---|---|
參量 |
| ||||
返回值 |
|
otChannelManagerSetFavoredChannels
void otChannelManagerSetFavoredChannels( otInstance *aInstance, uint32_t aChannelMask )
此功能設置首選的通道掩碼。
細節 | |||||
---|---|---|---|---|---|
參量 |
|
otChannelManagerSetSupportedChannels
void otChannelManagerSetSupportedChannels( otInstance *aInstance, uint32_t aChannelMask )
此功能設置支持的通道掩碼。
細節 | |||||
---|---|---|---|---|---|
參量 |
|