mirror of
https://github.com/espressif/openthread.git
synced 2026-07-08 21:30:24 +00:00
Implement ROUTER_DOWNGRADE_THRESHOLD. (#588)
This commit is contained in:
@@ -116,6 +116,7 @@ const struct Command Interpreter::sCommands[] =
|
||||
{ "rloc16", &Interpreter::ProcessRloc16 },
|
||||
{ "route", &Interpreter::ProcessRoute },
|
||||
{ "router", &Interpreter::ProcessRouter },
|
||||
{ "routerdowngradethreshold", &Interpreter::ProcessRouterDowngradeThreshold },
|
||||
{ "routerrole", &Interpreter::ProcessRouterRole },
|
||||
{ "routerupgradethreshold", &Interpreter::ProcessRouterUpgradeThreshold },
|
||||
{ "scan", &Interpreter::ProcessScan },
|
||||
@@ -1657,6 +1658,25 @@ exit:
|
||||
AppendResult(error);
|
||||
}
|
||||
|
||||
void Interpreter::ProcessRouterDowngradeThreshold(int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
long value;
|
||||
|
||||
if (argc == 0)
|
||||
{
|
||||
sServer->OutputFormat("%d\r\n", otGetRouterDowngradeThreshold());
|
||||
}
|
||||
else
|
||||
{
|
||||
SuccessOrExit(error = ParseLong(argv[0], value));
|
||||
otSetRouterDowngradeThreshold(static_cast<uint8_t>(value));
|
||||
}
|
||||
|
||||
exit:
|
||||
AppendResult(error);
|
||||
}
|
||||
|
||||
void Interpreter::ProcessRouterRole(int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
|
||||
Reference in New Issue
Block a user