This module includes functions for Channel Manager.
More...
This module includes functions for Channel Manager.
The functions in this module are available when Channel Manager feature (OPENTHREAD_ENABLE_CHANNEL_MANAGER
) is enabled. Channel Manager is available only on an FTD build.
bool otChannelManagerGetAutoChannelSelectionEnabled |
( |
otInstance * |
aInstance | ) |
|
This function indicates whether the auto-channel-selection functionality is enabled or not.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Returns
- TRUE if enabled, FALSE if disabled.
uint32_t otChannelManagerGetAutoChannelSelectionInterval |
( |
otInstance * |
aInstance | ) |
|
This function gets the period interval (in seconds) used by auto-channel-selection functionality.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Returns
- The interval in seconds.
uint16_t otChannelManagerGetDelay |
( |
otInstance * |
aInstance | ) |
|
This function gets the delay (in seconds) used by Channel Manager for a channel change.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Returns
- The delay (in seconds) for channel change.
uint32_t otChannelManagerGetFavoredChannels |
( |
otInstance * |
aInstance | ) |
|
This function gets the favored channel mask.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Returns
- The favored channels as a bit-mask.
uint8_t otChannelManagerGetRequestedChannel |
( |
otInstance * |
aInstance | ) |
|
This function gets the channel from the last successful call to otChannelManagerRequestChannelChange()
- Returns
- The last requested channel or zero if there has been no channel change request yet.
uint32_t otChannelManagerGetSupportedChannels |
( |
otInstance * |
aInstance | ) |
|
This function gets the supported channel mask.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Returns
- The supported channels as a bit-mask.
void otChannelManagerRequestChannelChange |
( |
otInstance * |
aInstance, |
|
|
uint8_t |
aChannel |
|
) |
| |
This function requests a Thread network channel change.
The network switches to the given channel after a specified delay (
- See also
- otChannelManagerSetDelay). The channel change is performed by updating the Pending Operational Dataset.
A subsequent call to this function will cancel an ongoing previously requested channel change.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aChannel | The new channel for the Thread network. |
otError otChannelManagerRequestChannelSelect |
( |
otInstance * |
aInstance, |
|
|
bool |
aSkipQualityCheck |
|
) |
| |
This function requests that ChannelManager
checks and selects a new channel and starts a channel change.
Unlike the otChannelManagerRequestChannelChange()
where the channel must be given as a parameter, this function asks the ChannelManager
to select a channel by itself (based of collected channel quality info).
Once called, the Channel Manager will perform the following 3 steps:
1) ChannelManager
decides if the channel change would be helpful. This check can be skipped if aSkipQualityCheck
is set to true (forcing a channel selection to happen and skipping the quality check). This step uses the collected link quality metrics on the device (such as CCA failure rate, frame and message error rates per neighbor, etc.) to determine if the current channel quality is at the level that justifies a channel change.
2) If the first step passes, then ChannelManager
selects a potentially better channel. It uses the collected channel quality data by ChannelMonitor
module. The supported and favored channels are used at this step. (
- See also
- otChannelManagerSetSupportedChannels,
-
otChannelManagerSetFavoredChannels).
3) If the newly selected channel is different from the current channel, ChannelManager
requests/starts the channel change process (internally invoking a RequestChannelChange()
).
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aSkipQualityCheck | Indicates whether the quality check (step 1) should be skipped. |
- Return values
-
OT_ERROR_NONE | Channel selection finished successfully. |
OT_ERROR_NOT_FOUND | Supported channel mask is empty, therefore could not select a channel. |
OT_ERROR_INVALID_STATE | Thread is not enabled or not enough data to select a new channel. |
OT_ERROR_DISABLED_FEATURE | ChannelMonintor feature is disabled by build-time configuration options. |
void otChannelManagerSetAutoChannelSelectionEnabled |
( |
otInstance * |
aInstance, |
|
|
bool |
aEnabled |
|
) |
| |
This function enables/disables the auto-channel-selection functionality.
When enabled, ChannelManager
will periodically invoke a RequestChannelSelect(false)
. The period interval can be set by SetAutoChannelSelectionInterval()
.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aEnabled | Indicates whether to enable or disable this functionality. |
otError otChannelManagerSetAutoChannelSelectionInterval |
( |
otInstance * |
aInstance, |
|
|
uint32_t |
aInterval |
|
) |
| |
This function sets the period interval (in seconds) used by auto-channel-selection functionality.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aInterval | The interval in seconds. |
- Return values
-
OT_ERROR_NONE | The interval was set successfully. |
OT_ERROR_INVALID_ARGS | The aInterval is not valid (zero). |
This function sets the delay (in seconds) used for a channel change.
The delay should preferably be longer than maximum data poll interval used by all sleepy-end-devices within the Thread network.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aDelay | Delay in seconds. |
- Return values
-
OT_ERROR_NONE | Delay was updated successfully. |
OT_ERROR_INVALID_ARGS | The given delay aDelay is too short. |
void otChannelManagerSetFavoredChannels |
( |
otInstance * |
aInstance, |
|
|
uint32_t |
aChannelMask |
|
) |
| |
This function sets the favored channel mask.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aChannelMask | A channel mask. |
void otChannelManagerSetSupportedChannels |
( |
otInstance * |
aInstance, |
|
|
uint32_t |
aChannelMask |
|
) |
| |
This function sets the supported channel mask.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aChannelMask | A channel mask. |