mirror of
https://github.com/espressif/openthread.git
synced 2026-07-27 06:17:47 +00:00
[cli] implement 'rcp version' command (#5051)
This commit is contained in:
@@ -75,6 +75,7 @@ Done
|
||||
- [prefix](#prefix-add-prefix-padcrosnD-prf)
|
||||
- [promiscuous](#promiscuous)
|
||||
- [pskc](#pskc--p-keypassphrase)
|
||||
- [rcp](#rcp)
|
||||
- [releaserouterid](#releaserouterid-routerid)
|
||||
- [reset](#reset)
|
||||
- [rloc16](#rloc16)
|
||||
@@ -1282,6 +1283,20 @@ Disable radio promiscuous operation.
|
||||
Done
|
||||
```
|
||||
|
||||
### rcp
|
||||
|
||||
RCP-related commands.
|
||||
|
||||
### rcp version
|
||||
|
||||
Print RCP version string.
|
||||
|
||||
```bash
|
||||
> rcp version
|
||||
OPENTHREAD/20191113-00825-g82053cc9d-dirty; SIMULATION; Jun 4 2020 17:53:16
|
||||
Done
|
||||
```
|
||||
|
||||
### releaserouterid \<routerid\>
|
||||
|
||||
Release a Router ID that has been allocated by the device in the Leader role.
|
||||
|
||||
+27
-1
@@ -214,6 +214,9 @@ const struct Command Interpreter::sCommands[] = {
|
||||
#if OPENTHREAD_FTD
|
||||
{"preferrouterid", &Interpreter::ProcessPreferRouterId},
|
||||
{"pskc", &Interpreter::ProcessPskc},
|
||||
#endif
|
||||
{"rcp", &Interpreter::ProcessRcp},
|
||||
#if OPENTHREAD_FTD
|
||||
{"releaserouterid", &Interpreter::ProcessReleaseRouterId},
|
||||
#endif
|
||||
{"reset", &Interpreter::ProcessReset},
|
||||
@@ -2792,7 +2795,30 @@ void Interpreter::ProcessPreferRouterId(uint8_t aArgsLength, char *aArgs[])
|
||||
exit:
|
||||
AppendResult(error);
|
||||
}
|
||||
#endif
|
||||
|
||||
void Interpreter::ProcessRcp(uint8_t aArgsLength, char *aArgs[])
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
const char *version = otPlatRadioGetVersionString(mInstance);
|
||||
|
||||
VerifyOrExit(version != otGetVersionString(), error = OT_ERROR_NOT_IMPLEMENTED);
|
||||
VerifyOrExit(aArgsLength > 0, error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
if (strcmp(aArgs[0], "version") == 0)
|
||||
{
|
||||
mServer->OutputFormat("%s\r\n", version);
|
||||
}
|
||||
else
|
||||
{
|
||||
ExitNow(error = OT_ERROR_INVALID_ARGS);
|
||||
}
|
||||
|
||||
exit:
|
||||
AppendResult(error);
|
||||
}
|
||||
|
||||
#if OPENTHREAD_FTD
|
||||
void Interpreter::ProcessReleaseRouterId(uint8_t aArgsLength, char *aArgs[])
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
@@ -2806,7 +2832,7 @@ void Interpreter::ProcessReleaseRouterId(uint8_t aArgsLength, char *aArgs[])
|
||||
exit:
|
||||
AppendResult(error);
|
||||
}
|
||||
#endif // OPENTHREAD_FTD
|
||||
#endif
|
||||
|
||||
void Interpreter::ProcessReset(uint8_t aArgsLength, char *aArgs[])
|
||||
{
|
||||
|
||||
@@ -328,6 +328,9 @@ private:
|
||||
#if OPENTHREAD_FTD
|
||||
void ProcessPreferRouterId(uint8_t aArgsLength, char *aArgs[]);
|
||||
void ProcessPskc(uint8_t aArgsLength, char *aArgs[]);
|
||||
#endif
|
||||
void ProcessRcp(uint8_t aArgsLength, char *aArgs[]);
|
||||
#if OPENTHREAD_FTD
|
||||
void ProcessReleaseRouterId(uint8_t aArgsLength, char *aArgs[]);
|
||||
#endif
|
||||
void ProcessReset(uint8_t aArgsLength, char *aArgs[]);
|
||||
|
||||
Reference in New Issue
Block a user