mirror of
https://github.com/espressif/openthread.git
synced 2026-08-05 18:37:45 +00:00
[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:
@@ -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
|
||||
|
||||
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user