[cli] add platform command which returns current platform (#8444)

Sometime we need to identify which platform we are currently using,
especially in a test cases, where a unified interface is provided to
control devices, the test cases have no idea about current platform.
This commit is contained in:
Zang MingJie
2022-12-06 13:23:55 -08:00
committed by GitHub
parent 9950ccf2fa
commit e8b34a46a7
2 changed files with 19 additions and 0 deletions
+11
View File
@@ -85,6 +85,7 @@ Done
- [parentpriority](#parentpriority)
- [partitionid](#partitionid)
- [ping](#ping-async--i-source-ipaddr-size-count-interval-hoplimit-timeout)
- [platform](#platform)
- [pollperiod](#pollperiod-pollperiod)
- [preferrouterid](#preferrouterid-routerid)
- [prefix](#prefix)
@@ -2336,6 +2337,16 @@ Stop sending ICMPv6 Echo Requests.
Done
```
### platform
Print the current platform
```bash
> platform
NRF52840
Done
```
### pollperiod
Get the customized data poll period of sleepy end device (milliseconds). Only for certification test
+8
View File
@@ -5477,6 +5477,13 @@ exit:
#endif // OPENTHREAD_CONFIG_PING_SENDER_ENABLE
template <> otError Interpreter::Process<Cmd("platform")>(Arg aArgs[])
{
OT_UNUSED_VARIABLE(aArgs);
OutputLine("%s", OPENTHREAD_CONFIG_PLATFORM_INFO);
return OT_ERROR_NONE;
}
template <> otError Interpreter::Process<Cmd("pollperiod")>(Arg aArgs[])
{
return ProcessGetSet(aArgs, otLinkGetPollPeriod, otLinkSetPollPeriod);
@@ -7335,6 +7342,7 @@ otError Interpreter::ProcessCommand(Arg aArgs[])
#if OPENTHREAD_CONFIG_PING_SENDER_ENABLE
CmdEntry("ping"),
#endif
CmdEntry("platform"),
CmdEntry("pollperiod"),
#if OPENTHREAD_FTD
CmdEntry("preferrouterid"),