通路經理
這個模組包含管道管理員的函式。
摘要
啟用頻道管理員功能 (OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
) 時,可使用這個模組中的函式。管道管理員僅適用於 FTD 版本。
Functions |
|
---|---|
otChannelManagerGetAutoChannelSelectionEnabled(otInstance *aInstance)
|
bool
這個函式可指出是否已啟用自動頻道選取功能。
|
otChannelManagerGetAutoChannelSelectionInterval(otInstance *aInstance)
|
uint32_t
這個函式會取得自動頻道選取功能使用的經期間隔 (以秒為單位)。
|
otChannelManagerGetCcaFailureRateThreshold(otInstance *aInstance)
|
uint16_t
取得 CCA 失敗率門檻。
|
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
要求變更 Thread 網路管道。
|
otChannelManagerRequestChannelSelect(otInstance *aInstance, bool aSkipQualityCheck)
|
這個函式會要求
ChannelManager 檢查並選取新管道,並啟動頻道變更。 |
otChannelManagerSetAutoChannelSelectionEnabled(otInstance *aInstance, bool aEnabled)
|
void
啟用或停用自動頻道選取功能。
|
otChannelManagerSetAutoChannelSelectionInterval(otInstance *aInstance, uint32_t aInterval)
|
設定自動頻道選取功能所使用的週期間隔 (以秒為單位)。
|
otChannelManagerSetCcaFailureRateThreshold(otInstance *aInstance, uint16_t aThreshold)
|
void
設定 CCA 失敗率門檻。
|
otChannelManagerSetDelay(otInstance *aInstance, uint16_t aDelay)
|
設定頻道變更所用的延遲時間 (以秒為單位)。
|
otChannelManagerSetFavoredChannels(otInstance *aInstance, uint32_t aChannelMask)
|
void
設定慣用頻道遮罩。
|
otChannelManagerSetSupportedChannels(otInstance *aInstance, uint32_t aChannelMask)
|
void
設定支援的頻道遮罩。
|
Functions
otChannelManagerGetAutoChannelSelectionEnabled
bool otChannelManagerGetAutoChannelSelectionEnabled( otInstance *aInstance )
這個函式可指出是否已啟用自動頻道選取功能。
詳情 | |||
---|---|---|---|
參數 |
|
||
傳回 |
設為 TRUE
|
otChannelManagerGetAutoChannelSelectionInterval
uint32_t otChannelManagerGetAutoChannelSelectionInterval( otInstance *aInstance )
這個函式會取得自動頻道選取功能使用的經期間隔 (以秒為單位)。
詳情 | |||
---|---|---|---|
參數 |
|
||
傳回 |
間隔時間 (以秒為單位)。
|
otChannelManagerGetCcaFailureRateThreshold
uint16_t otChannelManagerGetCcaFailureRateThreshold( otInstance *aInstance )
取得 CCA 失敗率門檻。
詳情 | |||
---|---|---|---|
參數 |
|
||
傳回 |
CCA 失敗率門檻。值 0 對應至 0%,0xffff 則對應至 100%。
|
otChannelManagerGetDelay
uint16_t otChannelManagerGetDelay( otInstance *aInstance )
這個管道會取得頻道管理員使用的頻道變更所需的延遲時間 (以秒為單位)。
詳情 | |||
---|---|---|---|
參數 |
|
||
傳回 |
版本變更的延遲時間 (以秒為單位)。
|
otChannelManagerGetFavoredChannels
uint32_t otChannelManagerGetFavoredChannels( otInstance *aInstance )
取得喜愛的頻道遮罩。
詳情 | |||
---|---|---|---|
參數 |
|
||
傳回 |
偏愛的頻道是口罩。
|
otChannelManagerGetRequestedChannel
uint8_t otChannelManagerGetRequestedChannel( otInstance *aInstance )
otChannelManagerGetSupportedChannels
uint32_t otChannelManagerGetSupportedChannels( otInstance *aInstance )
取得支援的頻道遮罩。
詳情 | |||
---|---|---|---|
參數 |
|
||
傳回 |
支援的位元遮罩。
|
otChannelManagerRequestChannelChange
void otChannelManagerRequestChannelChange( otInstance *aInstance, uint8_t aChannel )
要求變更 Thread 網路管道。
在指定延遲後,網路切換至指定管道 (請參閱 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 )
設定自動頻道選取功能所使用的週期間隔 (以秒為單位)。
詳情 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otChannelManagerSetCcaFailureRateThreshold
void otChannelManagerSetCcaFailureRateThreshold( otInstance *aInstance, uint16_t aThreshold )
設定 CCA 失敗率門檻。
詳情 | |||||
---|---|---|---|---|---|
參數 |
|
otChannelManagerSetDelay
otError otChannelManagerSetDelay( otInstance *aInstance, uint16_t aDelay )
設定頻道變更所用的延遲時間 (以秒為單位)。
延遲時間最好高於 Thread 網路中所有睡眠裝置所使用的資料輪詢間隔上限。
詳情 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otChannelManagerSetFavoredChannels
void otChannelManagerSetFavoredChannels( otInstance *aInstance, uint32_t aChannelMask )
設定慣用頻道遮罩。
詳情 | |||||
---|---|---|---|---|---|
參數 |
|
otChannelManagerSetSupportedChannels
void otChannelManagerSetSupportedChannels( otInstance *aInstance, uint32_t aChannelMask )
設定支援的頻道遮罩。
詳情 | |||||
---|---|---|---|---|---|
參數 |
|
資源
OpenThread API 參考資料主題出自原始碼,可於 GitHub 取得。如需更多資訊,或想參閱我們的說明文件,請參閱資源。