diff --git a/src/cli/README.md b/src/cli/README.md index 3da8e916e..fa3b69108 100644 --- a/src/cli/README.md +++ b/src/cli/README.md @@ -113,6 +113,26 @@ Set the IEEE 802.15.4 Channel value. Done ``` +### channel preferred + +Get preferred channel mask. + +```bash +> channel preferred +0x7fff800 +Done +``` + +### channel supported + +Get supported channel mask. + +```bash +> channel supported +0x7fff800 +Done +``` + ### child list List attached Child IDs. diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp index 88f9e34e9..0f4074f85 100644 --- a/src/cli/cli.cpp +++ b/src/cli/cli.cpp @@ -460,6 +460,14 @@ void Interpreter::ProcessChannel(int argc, char *argv[]) { mServer->OutputFormat("%d\r\n", otLinkGetChannel(mInstance)); } + else if (strcmp(argv[0], "supported") == 0) + { + mServer->OutputFormat("0x%x\r\n", otPlatRadioGetSupportedChannelMask(mInstance)); + } + else if (strcmp(argv[0], "preferred") == 0) + { + mServer->OutputFormat("0x%x\r\n", otPlatRadioGetPreferredChannelMask(mInstance)); + } #if OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE else if (strcmp(argv[0], "monitor") == 0) {